authenticate: fix wrong condition checking in VerifySession (#1146)

The code checks session client not nil, but using databroker client in
the body instead.
This commit is contained in:
Cuong Manh Le 2020-07-28 21:18:39 +07:00 committed by GitHub
parent bec908b9af
commit fd544b7072
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

View file

@ -137,7 +137,7 @@ func (a *Authenticate) VerifySession(next http.Handler) http.Handler {
return a.reauthenticateOrFail(w, r, err)
}
if a.sessionClient != nil {
if a.dataBrokerClient != nil {
_, err = session.Get(ctx, a.dataBrokerClient, sessionState.ID)
if err != nil {
log.FromRequest(r).Info().Err(err).Str("id", sessionState.ID).Msg("authenticate: session not found in databroker")