Skip to content
Snippets Groups Projects
Unverified Commit 73bf0911 authored by Rohith Jayawardene's avatar Rohith Jayawardene Committed by GitHub
Browse files

Logout Redirect Defaults (#376)

- change the default behaviour, if no redirect_ui set we default to the rediection-url and if not set we default to the Host header
parent d95cb7b4
No related branches found
No related tags found
No related merge requests found
...@@ -327,10 +327,16 @@ func (r *oauthProxy) logoutHandler(w http.ResponseWriter, req *http.Request) { ...@@ -327,10 +327,16 @@ func (r *oauthProxy) logoutHandler(w http.ResponseWriter, req *http.Request) {
// @check if we should redirect to the provider // @check if we should redirect to the provider
if r.config.EnableLogoutRedirect { if r.config.EnableLogoutRedirect {
sendTo := fmt.Sprintf("%s/protocol/openid-connect/logout", strings.TrimSuffix(r.config.DiscoveryURL, "/.well-known/openid-configuration")) sendTo := fmt.Sprintf("%s/protocol/openid-connect/logout", strings.TrimSuffix(r.config.DiscoveryURL, "/.well-known/openid-configuration"))
// @step: if not redirect uri is set we default back to the hostname
// @step: if no redirect uri is set
if redirectURL == "" { if redirectURL == "" {
// @step: we first check for a redirection-url and then host header
if r.config.RedirectionURL != "" {
redirectURL = r.config.RedirectionURL
} else {
redirectURL = getRequestHostURL(req) redirectURL = getRequestHostURL(req)
} }
}
r.redirectToURL(fmt.Sprintf("%s?redirect_uri=%s", sendTo, url.QueryEscape(redirectURL)), w, req) r.redirectToURL(fmt.Sprintf("%s?redirect_uri=%s", sendTo, url.QueryEscape(redirectURL)), w, req)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment