Skip to content

Commit

Permalink
Redirect to base path / after logout (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-ruth authored Nov 30, 2021
1 parent 4147247 commit 9078819
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions proxy/logoutHandler.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,7 @@ func logoutGetHandler(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusInternalServerError)
return
}

// Redirect to base path
http.Redirect(w, r, "/", http.StatusFound)
}
2 changes: 1 addition & 1 deletion proxy/tokenHelpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ func deleteTokenCookie(w http.ResponseWriter, r *http.Request) error {
// List token parts cookies
for _, cookie := range r.Cookies() {
if cookieRegex.MatchString(cookie.Name) {
http.SetCookie(w, &http.Cookie{Name: cookie.Name, Value: "", MaxAge: 0})
http.SetCookie(w, &http.Cookie{Name: cookie.Name, Value: "", MaxAge: -1})
}
}

Expand Down

0 comments on commit 9078819

Please sign in to comment.