From 3b3c8f32024a3300b45954f24a1dc7acc6754165 Mon Sep 17 00:00:00 2001 From: Alexander Lupatsiy Date: Sat, 12 Sep 2026 21:19:12 +0200 Subject: [PATCH] refactor: rely on the default auth return path --- go+htmx/handlers/handlers.go | 13 +++++-------- go+react/web/src/App.jsx | 2 +- 2 files changed, 6 insertions(+), 9 deletions(-) diff --git a/go+htmx/handlers/handlers.go b/go+htmx/handlers/handlers.go index f56d91e..c75a047 100644 --- a/go+htmx/handlers/handlers.go +++ b/go+htmx/handlers/handlers.go @@ -43,7 +43,7 @@ func (h *Handler) Home(w http.ResponseWriter, r *http.Request) { data := HomeData{ LoggedIn: user != nil, - LoginURL: "/auth/login?return_to=/private", + LoginURL: "/auth/login", } if user != nil { data.Username = user.Username @@ -62,16 +62,13 @@ func (h *Handler) Private(w http.ResponseWriter, r *http.Request) { } if user == nil { - http.Redirect(w, r, "/auth/login?return_to=/private", http.StatusSeeOther) + http.Redirect(w, r, "/auth/login", http.StatusSeeOther) return } - logout, ok := authara.LogoutFormDataFromRequest( - r, - "/auth/login?return_to=/private", - ) + logout, ok := authara.LogoutFormDataFromRequest(r, "") if !ok { - http.Redirect(w, r, "/auth/login?return_to=/private", http.StatusSeeOther) + http.Redirect(w, r, "/auth/login", http.StatusSeeOther) return } @@ -95,7 +92,7 @@ func (h *Handler) PrivatePulse(w http.ResponseWriter, r *http.Request) { } if user == nil { - http.Redirect(w, r, "/auth/login?return_to=/private", http.StatusSeeOther) + http.Redirect(w, r, "/auth/login", http.StatusSeeOther) return } diff --git a/go+react/web/src/App.jsx b/go+react/web/src/App.jsx index 28131ee..857663e 100644 --- a/go+react/web/src/App.jsx +++ b/go+react/web/src/App.jsx @@ -12,7 +12,7 @@ export default function App() { const isPrivate = window.location.pathname === "/private"; - const loginURL = "/auth/login?return_to=/private"; + const loginURL = "/auth/login"; if (user === undefined) { return (