authenticate: clear session if ctx fails (#806)

Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
Bobby DeSimone 2020-05-29 17:25:09 -07:00 committed by GitHub
parent b88a619c0d
commit eae217851a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -221,10 +221,12 @@ func (a *Authenticate) SignIn(w http.ResponseWriter, r *http.Request) error {
s, err := a.getSessionFromCtx(ctx)
if err != nil {
a.sessionStore.ClearSession(w, r)
return err
}
accessToken, err := a.getAccessToken(ctx, s)
if err != nil {
a.sessionStore.ClearSession(w, r)
return err
}
// user impersonation