Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions internal/session/manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -285,14 +285,20 @@
}

func (m *Manager) Validate(r *http.Request) (Session, bool) {
cookie, err := r.Cookie(m.cookieName)
cookie, err := r.Cookie(m.cookieName)ň

Check failure on line 288 in internal/session/manager.go

View workflow job for this annotation

GitHub Actions / test

syntax error: unexpected name ň at end of statement

Check failure on line 288 in internal/session/manager.go

View workflow job for this annotation

GitHub Actions / security-check

expected ';', found ň

Check failure on line 288 in internal/session/manager.go

View workflow job for this annotation

GitHub Actions / security-check

syntax error: unexpected name ň at end of statement
if err != nil || cookie.Value == "" {
return Session{}, false
}
m.mu.RLock()
session, ok := m.sessions[hash(cookie.Value)]
m.mu.RUnlock()
if !ok || time.Now().After(session.expiresAt) {
if !ok {
return Session{}, false
}
if time.Now().After(session.expiresAt) {
m.mu.Lock()
delete(m.sessions, hash(cookie.Value))
m.mu.Unlock()
return Session{}, false
}
if subtle.ConstantTimeCompare([]byte(session.fingerprintHash), []byte(browserFingerprint(r))) != 1 {
Expand Down
Loading