fix(auth): redirect back to workspace after Authelia logout
This commit is contained in:
parent
b5ed7e2364
commit
bc7d546e64
1 changed files with 3 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"log/slog"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"net/url"
|
||||||
"os"
|
"os"
|
||||||
"os/signal"
|
"os/signal"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
|
|
@ -132,8 +133,8 @@ func main() {
|
||||||
HttpOnly: true,
|
HttpOnly: true,
|
||||||
SameSite: http.SameSiteLaxMode,
|
SameSite: http.SameSiteLaxMode,
|
||||||
})
|
})
|
||||||
// Redirect to Authelia's logout page to clear Authelia session
|
// Redirect to Authelia's logout page, then back to workspace
|
||||||
logoutURL := fmt.Sprintf("%s/logout", cfg.OIDC.IssuerURL)
|
logoutURL := fmt.Sprintf("%s/logout?rd=%s", cfg.OIDC.IssuerURL, url.QueryEscape(cfg.OIDC.RedirectURL))
|
||||||
http.Redirect(w, r, logoutURL, http.StatusFound)
|
http.Redirect(w, r, logoutURL, http.StatusFound)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue