providers/proxy: fix panic when claims in session were nil (#5569)

* providers/proxy: fix panic when claims in session were nil

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

* add new options

Signed-off-by: Jens Langhammer <jens@goauthentik.io>

---------

Signed-off-by: Jens Langhammer <jens@goauthentik.io>
This commit is contained in:
Jens L
2023-05-10 20:58:44 +02:00
committed by GitHub
parent c68a42f63b
commit 906faf9cce
2 changed files with 26 additions and 0 deletions

View File

@ -94,6 +94,10 @@ func (a *Application) Logout(sub string) error {
a.log.WithError(err).Trace("failed to decode session")
continue
}
rc, ok := s.Values[constants.SessionClaims]
if !ok || rc == nil {
continue
}
claims := s.Values[constants.SessionClaims].(Claims)
if claims.Sub == sub {
a.log.WithField("path", fullPath).Trace("deleting session")