renaming clear all, removing panik

This commit is contained in:
Felipe Fey 2025-06-09 14:07:00 -03:00
parent c454e8d4d9
commit c898672fcb
No known key found for this signature in database
GPG Key ID: E0AFBAF11D95CBE3
4 changed files with 5 additions and 5 deletions

View File

@ -565,7 +565,7 @@ func (p *OAuthProxy) ClearSessionCookie(rw http.ResponseWriter, req *http.Reques
}
func (p *OAuthProxy) ClearAllSessions(req *http.Request, session *sessionsapi.SessionState) error {
return p.sessionStore.ClearAll(req, session)
return p.sessionStore.ClearAllUserSessions(req, session)
}
// LoadCookiedSession reads the user's authentication details from the request

View File

@ -12,7 +12,7 @@ type SessionStore interface {
Save(rw http.ResponseWriter, req *http.Request, s *SessionState) error
Load(req *http.Request) (*SessionState, error)
Clear(rw http.ResponseWriter, req *http.Request) error
ClearAll(req *http.Request, session *SessionState) error
ClearAllUserSessions(req *http.Request, session *SessionState) error
VerifyConnection(ctx context.Context) error
}

View File

@ -34,8 +34,8 @@ type SessionStore struct {
}
// ClearAll implements sessions.SessionStore.
func (s *SessionStore) ClearAll(req *http.Request, session *sessions.SessionState) error {
panic("unimplemented")
func (s *SessionStore) ClearAllUserSessions(req *http.Request, session *sessions.SessionState) error {
return fmt.Errorf("ClearAllUserSessions is only supported by redis store")
}
// Save takes a sessions.SessionState and stores the information from it

View File

@ -75,7 +75,7 @@ func (m *Manager) Load(req *http.Request) (*sessions.SessionState, error) {
}
// ClearAll implements sessions.SessionStore.
func (m *Manager) ClearAll(req *http.Request, session *sessions.SessionState) error {
func (m *Manager) ClearAllUserSessions(req *http.Request, session *sessions.SessionState) error {
ticket, _ := decodeTicketFromRequest(req, m.Options)
sessionKey := encryption.EncryptStringWithSecret(session.User+session.Email, ticket.options.Secret)
keys, err := m.Store.LoadList(req.Context(), sessionKey)