1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-17 00:17:40 +02:00

fix(1356): test if session variable is null (#1357)

* fix(1356): test if session variable is null

* fix(1356): adding changelog

Co-authored-by: Hedi Harzallah <hharzalla@talend.com>
This commit is contained in:
Hedi Harzallah
2021-09-09 13:12:29 +02:00
committed by GitHub
parent 54d44ccb8f
commit ccbb98acd9
2 changed files with 4 additions and 1 deletions

View File

@ -31,7 +31,9 @@ func loadBasicAuthSession(validator basic.Validator, sessionGroups []string, pre
if preferEmail {
getSession = func(validator basic.Validator, sessionGroups []string, req *http.Request) (*sessionsapi.SessionState, error) {
session, err := getBasicSession(validator, sessionGroups, req)
session.Email = session.User
if session != nil {
session.Email = session.User
}
return session, err
}
}