Desimone/authenticate default logout (#1390)

* authenticate: fix unset post_logout_redirect_uri
* don't show url if does not exist
Signed-off-by: Bobby DeSimone <bobbydesimone@gmail.com>
This commit is contained in:
bobby 2020-09-09 11:53:12 -07:00 committed by Bobby DeSimone
parent 0834f24907
commit 7d10b3ddd4
3 changed files with 6 additions and 6 deletions

View file

@ -270,7 +270,7 @@ func (a *Authenticate) SignOut(w http.ResponseWriter, r *http.Request) error {
a.sessionStore.ClearSession(w, r)
redirectString := r.FormValue(urlutil.QueryRedirectURI)
endSessionURL, err := a.provider.LogOut()
if err == nil {
if err == nil && redirectString != "" {
params := url.Values{}
params.Add("post_logout_redirect_uri", redirectString)
endSessionURL.RawQuery = params.Encode()

View file

@ -27,11 +27,12 @@
<section>
<p class="message">Your current session details.</p>
<fieldset>
{{if .RedirectURL}}
<label>
<span>URL</span>
<a href="{{.RedirectURL}}">{{.RedirectURL}}</a>
</label>
{{end}}
{{if .User.Name}}
<label>
<span>Name</span>

File diff suppressed because one or more lines are too long