fix(auth): logout redirects to workspace, which redirects to Authelia login

This commit is contained in:
Claus Lohmar 2026-06-15 08:10:35 +00:00
parent 2489ac589e
commit 49c4254594

View file

@ -7,7 +7,6 @@ import (
"fmt"
"log/slog"
"net/http"
"net/url"
"os"
"os/signal"
"path/filepath"
@ -133,10 +132,8 @@ func main() {
HttpOnly: true,
SameSite: http.SameSiteLaxMode,
})
// 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)
// Clear NextWks session, redirect to workspace (no session → Authelia login)
http.Redirect(w, r, "/", http.StatusFound)
})
// --- Workspace launcher (public, but OIDC-protected) ---