add authenticate events

This commit is contained in:
Denis Mishin 2023-04-25 17:10:46 -04:00
parent 3d9322bd32
commit dda4a878bc
4 changed files with 63 additions and 3 deletions

View file

@ -216,6 +216,8 @@ func (a *Authenticate) SignIn(w http.ResponseWriter, r *http.Request) error {
a.cfg.profileTrimFn(profile)
}
a.logAuthenticateEvent(r, profile)
redirectTo, err := urlutil.CallbackURL(state.hpkePrivateKey, proxyPublicKey, requestParams, profile)
if err != nil {
return httputil.NewError(http.StatusInternalServerError, err)
@ -315,6 +317,8 @@ func (a *Authenticate) reauthenticateOrFail(w http.ResponseWriter, r *http.Reque
return err
}
a.logAuthenticateEvent(r, nil)
state.sessionStore.ClearSession(w, r)
redirectURL := state.redirectURL.ResolveReference(r.URL)
nonce := csrf.Token(r)