From a1cd755597cae66cebd725e33aba88adb31a7aee Mon Sep 17 00:00:00 2001 From: yusing Date: Thu, 4 Sep 2025 06:42:18 +0800 Subject: [PATCH] refactor(auth): change PostAuthCallbackHandler to redirect after successful authentication --- internal/auth/userpass.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/internal/auth/userpass.go b/internal/auth/userpass.go index 52f13f24..5ec61f1c 100644 --- a/internal/auth/userpass.go +++ b/internal/auth/userpass.go @@ -125,7 +125,7 @@ func (auth *UserPassAuth) PostAuthCallbackHandler(w http.ResponseWriter, r *http return } SetTokenCookie(w, r, auth.TokenCookieName(), token, auth.tokenTTL) - w.WriteHeader(http.StatusOK) + http.Redirect(w, r, "/", http.StatusFound) } func (auth *UserPassAuth) LoginHandler(w http.ResponseWriter, r *http.Request) {