You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2025-06-15 00:15:00 +02:00
* Error page for session validation failure * Fix existing tests * Add test-case for session validation failure * Simplify test * Add changelog entry for PR Co-authored-by: Joel Speed <Joel.speed@hotmail.co.uk>
This commit is contained in:
@ -755,7 +755,11 @@ func (p *OAuthProxy) OAuthCallback(rw http.ResponseWriter, req *http.Request) {
|
||||
}
|
||||
|
||||
csrf.SetSessionNonce(session)
|
||||
p.provider.ValidateSession(req.Context(), session)
|
||||
if !p.provider.ValidateSession(req.Context(), session) {
|
||||
logger.PrintAuthf(session.Email, req, logger.AuthFailure, "Session validation failed: %s", session)
|
||||
p.ErrorPage(rw, req, http.StatusForbidden, "Session validation failed")
|
||||
return
|
||||
}
|
||||
|
||||
if !p.redirectValidator.IsValidRedirect(appRedirect) {
|
||||
appRedirect = "/"
|
||||
|
Reference in New Issue
Block a user