MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / isValid

Method isValid

apps/server/internal/httpserver/security.go:109–123  ·  view source on GitHub ↗
(token string)

Source from the content-addressed store, hash-verified

107}
108
109func (s *sessionStore) isValid(token string) bool {
110 if strings.TrimSpace(token) == "" {
111 return false
112 }
113 now := time.Now()
114 s.mu.Lock()
115 defer s.mu.Unlock()
116 for key, expiresAt := range s.sessions {
117 if now.After(expiresAt) {
118 delete(s.sessions, key)
119 }
120 }
121 expiresAt, ok := s.sessions[token]
122 return ok && now.Before(expiresAt)
123}
124
125func (s *sessionStore) delete(token string) {
126 if strings.TrimSpace(token) == "" {

Calls

no outgoing calls