mirror of
https://github.com/volatiletech/authboss.git
synced 2024-11-28 08:58:38 +02:00
Merge branch 'abelkuruvilla/master' into dev
This commit is contained in:
commit
ab5003c870
@ -28,6 +28,7 @@ const (
|
||||
EventGetUser
|
||||
EventGetUserSession
|
||||
EventPasswordReset
|
||||
EventLogout
|
||||
)
|
||||
|
||||
// EventHandler reacts to events that are fired by Authboss controllers.
|
||||
|
@ -49,10 +49,25 @@ func (l *Logout) Logout(w http.ResponseWriter, r *http.Request) error {
|
||||
logger.Info("user (unknown) logged out")
|
||||
}
|
||||
|
||||
var handled bool
|
||||
handled, err = l.Events.FireBefore(authboss.EventLogout, w, r)
|
||||
if err != nil {
|
||||
return err
|
||||
} else if handled {
|
||||
return nil
|
||||
}
|
||||
|
||||
authboss.DelAllSession(w, l.Config.Storage.SessionStateWhitelistKeys)
|
||||
authboss.DelKnownSession(w)
|
||||
authboss.DelKnownCookie(w)
|
||||
|
||||
handled, err = l.Authboss.Events.FireAfter(authboss.EventLogout, w, r)
|
||||
if err != nil {
|
||||
return err
|
||||
} else if handled {
|
||||
return nil
|
||||
}
|
||||
|
||||
ro := authboss.RedirectOptions{
|
||||
Code: http.StatusTemporaryRedirect,
|
||||
RedirectPath: l.Authboss.Paths.LogoutOK,
|
||||
|
Loading…
Reference in New Issue
Block a user