all: add signout redirect url (#1324)

Fixes #1213
This commit is contained in:
Cuong Manh Le 2020-08-25 01:23:58 +07:00 committed by GitHub
parent 3d7206dc1e
commit 9de99d0211
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 63 additions and 34 deletions

View file

@ -281,7 +281,14 @@ func (a *Authenticate) SignOut(w http.ResponseWriter, r *http.Request) error {
// no matter what happens, we want to clear the session store
state.sessionStore.ClearSession(w, r)
redirectString := r.FormValue(urlutil.QueryRedirectURI)
redirectString := ""
if sru := a.options.Load().SignOutRedirectURL; sru != nil {
redirectString = sru.String()
}
if uri := r.FormValue(urlutil.QueryRedirectURI); uri != "" {
redirectString = uri
}
endSessionURL, err := a.provider.Load().LogOut()
if err == nil {
params := url.Values{}