fix(auth): redirect back to workspace after Authelia logout

This commit is contained in:
Claus Lohmar 2026-06-15 08:02:49 +00:00
parent b5ed7e2364
commit bc7d546e64

View file

@ -7,6 +7,7 @@ import (
"fmt"
"log/slog"
"net/http"
"net/url"
"os"
"os/signal"
"path/filepath"
@ -132,8 +133,8 @@ func main() {
HttpOnly: true,
SameSite: http.SameSiteLaxMode,
})
// Redirect to Authelia's logout page to clear Authelia session
logoutURL := fmt.Sprintf("%s/logout", cfg.OIDC.IssuerURL)
// 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))
http.Redirect(w, r, logoutURL, http.StatusFound)
})