1
0
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:
Aaron L 2019-10-21 10:41:24 -07:00
commit ab5003c870
2 changed files with 16 additions and 0 deletions

View File

@ -28,6 +28,7 @@ const (
EventGetUser
EventGetUserSession
EventPasswordReset
EventLogout
)
// EventHandler reacts to events that are fired by Authboss controllers.

View File

@ -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,