fix: backend logout URL call on sign out (#3172) (#3352)

* Fix backend logout URL call on sign out (#3172)

Signed-off-by: Vivek Sejpal <vsejpal@gmail.com>

* doc: changelog entry for #3352

Signed-off-by: Jan Larwig <jan@larwig.com>

---------

Signed-off-by: Vivek Sejpal <vsejpal@gmail.com>
Signed-off-by: Jan Larwig <jan@larwig.com>
Co-authored-by: Jan Larwig <jan@larwig.com>
This commit is contained in:
Vivek S Sejpal
2026-03-14 10:05:57 +08:00
committed by GitHub
co-authored by Jan Larwig
parent 88075737a6
commit 75ff537915
3 changed files with 44 additions and 2 deletions
+4 -2
View File
@@ -746,6 +746,10 @@ func (p *OAuthProxy) SignOut(rw http.ResponseWriter, req *http.Request) {
p.ErrorPage(rw, req, http.StatusInternalServerError, err.Error())
return
}
// Call backend logout before clearing the session so we still have the session
// (and id_token) available to invoke the provider's logout endpoint
p.backendLogout(rw, req)
err = p.ClearSessionCookie(rw, req)
if err != nil {
logger.Errorf("Error clearing session cookie: %v", err)
@@ -753,8 +757,6 @@ func (p *OAuthProxy) SignOut(rw http.ResponseWriter, req *http.Request) {
return
}
p.backendLogout(rw, req)
http.Redirect(rw, req, redirect, http.StatusFound)
}