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 GitHub
parent 1fcd86120b
commit 05d9fbb4b3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 3 deletions

View file

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

View file

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

File diff suppressed because one or more lines are too long