fix(auth): force re-login via prompt=login for proper logout

This commit is contained in:
Claus Lohmar 2026-06-15 08:07:54 +00:00
parent bc7d546e64
commit 2489ac589e

View file

@ -133,8 +133,9 @@ func main() {
HttpOnly: true,
SameSite: http.SameSiteLaxMode,
})
// Redirect to Authelia's logout page, then back to workspace
logoutURL := fmt.Sprintf("%s/logout?rd=%s", cfg.OIDC.IssuerURL, url.QueryEscape(cfg.OIDC.RedirectURL))
// Clear NextWks session, force re-login via Authelia
logoutURL := fmt.Sprintf("%s/api/oidc/authorize?prompt=login&response_type=code&client_id=%s&redirect_uri=%s&scope=openid+profile+email&state=logout&nonce=logout",
cfg.OIDC.IssuerURL, url.QueryEscape(cfg.OIDC.ClientID), url.QueryEscape(cfg.OIDC.RedirectURL))
http.Redirect(w, r, logoutURL, http.StatusFound)
})