git.iko.soy/typeable/oauth2-proxy
on master help sign in
Add redirect capability to sign_out (#314)

* addint redirect capability to sign_out * updating changelog

commitca0b8375da57b84e33b3869ae0c0024c35d17177 authorMoraru Costel <moraru_costel@yahoo.com> dateTue 19 Nov 2019, 18:17 (7 years ago) parent68abf7b
2 files changed+8−1
CHANGELOG.md+1 oauthproxy.go+7−1
CHANGELOG.md+1
@@ -15,6 +15,7 @@
1515- [#300](https://github.com/pusher/oauth2_proxy/pull/300) Added userinfo endpoint (@kbabuadze)
1616- [#309](https://github.com/pusher/oauth2_proxy/pull/309) Added support for custom CA when connecting to Redis cache (@lleszczu)
1717- [#248](https://github.com/pusher/oauth2_proxy/pull/248) Fix issue with X-Auth-Request-Redirect header being ignored (@webnard)
18+- [#314](https://github.com/pusher/oauth2_proxy/pull/314) Add redirect capability to sign_out (@costelmoraru)
1819- [#265](https://github.com/pusher/oauth2_proxy/pull/265) Add upstream with static response (@cgroschupp)
1920
2021# v4.0.0
oauthproxy.go+7−1
@@ -620,8 +620,14 @@ func (p *OAuthProxy) UserInfo(rw http.ResponseWriter, req *http.Request) {
620620
621621// SignOut sends a response to clear the authentication cookie
622622func (p *OAuthProxy) SignOut(rw http.ResponseWriter, req *http.Request) {
623+ redirect, err := p.GetRedirect(req)
624+ if err != nil {
625+ logger.Printf("Error obtaining redirect: %s", err.Error())
626+ p.ErrorPage(rw, 500, "Internal Error", err.Error())
627+ return
628+ }
623629 p.ClearSessionCookie(rw, req)
624− http.Redirect(rw, req, "/", 302)
630+ http.Redirect(rw, req, redirect, 302)
625631}
626632
627633// OAuthStart starts the OAuth2 authentication flow