From 43b32cc881a2e042cd35ba1d976ab36ce6754465 Mon Sep 17 00:00:00 2001 From: cclohmar Date: Mon, 15 Jun 2026 20:06:34 +0000 Subject: [PATCH] feat(auth): /access callback, nextwks.eu cookie domain --- app/config.yaml | 2 +- src/main.go | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/config.yaml b/app/config.yaml index 3f251e2..2207cc0 100644 --- a/app/config.yaml +++ b/app/config.yaml @@ -22,7 +22,7 @@ oidc: issuer_url: "https://auth.lohmar.co.uk" client_id: "nextwks" client_secret: "" - redirect_url: "https://wks.lohmar.co.uk/auth/callback" + redirect_url: "https://wks.lohmar.co.uk/access" domain: "wks.lohmar.co.uk" smtp: diff --git a/src/main.go b/src/main.go index 58288e5..85467aa 100644 --- a/src/main.go +++ b/src/main.go @@ -108,14 +108,14 @@ func main() { // Setup HTTP router mux := http.NewServeMux() - // Reverse proxy: /auth/* → Authelia (except /auth/callback) + // Reverse proxy: /auth/* → Authelia (except /access) autheliaProxy := httputil.NewSingleHostReverseProxy(&url.URL{ Scheme: "http", Host: fmt.Sprintf("%s:%d", "127.0.0.1", 9091), }) mux.HandleFunc("GET /auth/", func(w http.ResponseWriter, r *http.Request) { - // Skip /auth/callback and /auth/login /auth/logout — handled by NextWks - if r.URL.Path == "/auth/callback" || r.URL.Path == "/auth/login" || r.URL.Path == "/auth/logout" { + // Skip /access — handled by NextWks + if r.URL.Path == "/access" || r.URL.Path == "/auth/login" || r.URL.Path == "/auth/logout" { http.NotFound(w, r) return } @@ -137,8 +137,8 @@ func main() { // --- OIDC auth routes (public) --- mux.HandleFunc("GET /auth/login", oidcHandler.LoginRedirect) - mux.HandleFunc("GET /auth/callback", oidcHandler.Callback) - mux.HandleFunc("POST /auth/callback", oidcHandler.Callback) + mux.HandleFunc("GET /access", oidcHandler.Callback) + mux.HandleFunc("POST /access", oidcHandler.Callback) mux.HandleFunc("GET /auth/logout", func(w http.ResponseWriter, r *http.Request) { // Check if this is the return from Authelia logout (no NextWks cookie) if _, err := r.Cookie("nextwks_session"); err != nil {