mirror of
https://github.com/pomerium/pomerium.git
synced 2025-06-08 13:52:53 +02:00
proxy: redirect to dashboard for logout (#1944)
This commit is contained in:
parent
a78dae7f6f
commit
4f2bb60adb
3 changed files with 4 additions and 7 deletions
|
@ -65,13 +65,13 @@ func (p *Proxy) SignOut(w http.ResponseWriter, r *http.Request) {
|
||||||
redirectURL = uri
|
redirectURL = uri
|
||||||
}
|
}
|
||||||
|
|
||||||
signoutURL := *state.authenticateSignoutURL
|
dashboardURL := *state.authenticateDashboardURL
|
||||||
q := signoutURL.Query()
|
q := dashboardURL.Query()
|
||||||
q.Set(urlutil.QueryRedirectURI, redirectURL.String())
|
q.Set(urlutil.QueryRedirectURI, redirectURL.String())
|
||||||
signoutURL.RawQuery = q.Encode()
|
dashboardURL.RawQuery = q.Encode()
|
||||||
|
|
||||||
state.sessionStore.ClearSession(w, r)
|
state.sessionStore.ClearSession(w, r)
|
||||||
httputil.Redirect(w, r, urlutil.NewSignedURL(state.sharedKey, &signoutURL).String(), http.StatusFound)
|
httputil.Redirect(w, r, urlutil.NewSignedURL(state.sharedKey, &dashboardURL).String(), http.StatusFound)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (p *Proxy) userInfo(w http.ResponseWriter, r *http.Request) {
|
func (p *Proxy) userInfo(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
|
@ -25,7 +25,6 @@ const (
|
||||||
// authenticate urls
|
// authenticate urls
|
||||||
dashboardPath = "/.pomerium"
|
dashboardPath = "/.pomerium"
|
||||||
signinURL = "/.pomerium/sign_in"
|
signinURL = "/.pomerium/sign_in"
|
||||||
signoutURL = "/.pomerium/sign_out"
|
|
||||||
refreshURL = "/.pomerium/refresh"
|
refreshURL = "/.pomerium/refresh"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,6 @@ type proxyState struct {
|
||||||
authenticateURL *url.URL
|
authenticateURL *url.URL
|
||||||
authenticateDashboardURL *url.URL
|
authenticateDashboardURL *url.URL
|
||||||
authenticateSigninURL *url.URL
|
authenticateSigninURL *url.URL
|
||||||
authenticateSignoutURL *url.URL
|
|
||||||
authenticateRefreshURL *url.URL
|
authenticateRefreshURL *url.URL
|
||||||
|
|
||||||
encoder encoding.MarshalUnmarshaler
|
encoder encoding.MarshalUnmarshaler
|
||||||
|
@ -61,7 +60,6 @@ func newProxyStateFromConfig(cfg *config.Config) (*proxyState, error) {
|
||||||
state.authenticateURL, _ = urlutil.DeepCopy(cfg.Options.AuthenticateURL)
|
state.authenticateURL, _ = urlutil.DeepCopy(cfg.Options.AuthenticateURL)
|
||||||
state.authenticateDashboardURL = state.authenticateURL.ResolveReference(&url.URL{Path: dashboardPath})
|
state.authenticateDashboardURL = state.authenticateURL.ResolveReference(&url.URL{Path: dashboardPath})
|
||||||
state.authenticateSigninURL = state.authenticateURL.ResolveReference(&url.URL{Path: signinURL})
|
state.authenticateSigninURL = state.authenticateURL.ResolveReference(&url.URL{Path: signinURL})
|
||||||
state.authenticateSignoutURL = state.authenticateURL.ResolveReference(&url.URL{Path: signoutURL})
|
|
||||||
state.authenticateRefreshURL = state.authenticateURL.ResolveReference(&url.URL{Path: refreshURL})
|
state.authenticateRefreshURL = state.authenticateURL.ResolveReference(&url.URL{Path: refreshURL})
|
||||||
|
|
||||||
state.sessionStore, err = cookie.NewStore(func() cookie.Options {
|
state.sessionStore, err = cookie.NewStore(func() cookie.Options {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue