renaming clear all, removing panik
This commit is contained in:
parent
c454e8d4d9
commit
c898672fcb
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in New Issue