Skip to content

Commit

Permalink
consent: Always bust auth session if remember is false
Browse files Browse the repository at this point in the history
Closes #859
  • Loading branch information
arekkas authored and arekkas committed May 20, 2018
1 parent 7675144 commit b2725a7
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions consent/strategy_default.go
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,10 @@ func (s *DefaultStrategy) verifyAuthentication(w http.ResponseWriter, r *http.Re
}

if !session.Remember {
if session.Subject != session.AuthenticationRequest.Subject {
// We should not remember the session but at the same time a different user has logged in than was previously
// logged in - so let's bust that authentication.
if err := s.revokeAuthenticationSession(w, r); err != nil {
return nil, err
}
// If the session should not be remembered, than the user clearly don't wants us to store a cookie. So let's
// bust the authentication session (if one exists).
if err := s.revokeAuthenticationSession(w, r); err != nil {
return nil, err
}

return session, nil
Expand Down

0 comments on commit b2725a7

Please sign in to comment.