Skip to content

Commit

Permalink
Return 418 on CSRF token error
Browse files Browse the repository at this point in the history
  • Loading branch information
medanthelinium committed Oct 2, 2024
1 parent 165d9c8 commit 6154987
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion oauthproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -873,7 +873,7 @@ func (p *OAuthProxy) OAuthCallback(rw http.ResponseWriter, req *http.Request) {
csrf, err := cookies.LoadCSRFCookie(req, p.CookieOptions)
if err != nil {
logger.Println(req, logger.AuthFailure, "Invalid authentication via OAuth2. Error while loading CSRF cookie:", err.Error())
p.ErrorPage(rw, req, http.StatusForbidden, err.Error(), "Login Failed: Unable to find a valid CSRF token. Please try again.")
p.ErrorPage(rw, req, http.StatusTeapot, err.Error(), "Login Failed: Unable to find a valid CSRF token. Please try again.")
return
}

Expand Down

0 comments on commit 6154987

Please sign in to comment.