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

Add redirect capability to sign_out (#314)

* addint redirect capability to sign_out

* updating changelog
This commit is contained in:
Moraru Costel
2019-11-19 18:17:26 +01:00
committed by Joel Speed
parent 68abf7b2d8
commit ca0b8375da
2 changed files with 8 additions and 1 deletions

View File

@ -620,8 +620,14 @@ func (p *OAuthProxy) UserInfo(rw http.ResponseWriter, req *http.Request) {
// SignOut sends a response to clear the authentication cookie
func (p *OAuthProxy) SignOut(rw http.ResponseWriter, req *http.Request) {
redirect, err := p.GetRedirect(req)
if err != nil {
logger.Printf("Error obtaining redirect: %s", err.Error())
p.ErrorPage(rw, 500, "Internal Error", err.Error())
return
}
p.ClearSessionCookie(rw, req)
http.Redirect(rw, req, "/", 302)
http.Redirect(rw, req, redirect, 302)
}
// OAuthStart starts the OAuth2 authentication flow