refactor(auth): change PostAuthCallbackHandler to redirect to home page instead of sending OK status

This commit is contained in:
yusing
2025-09-13 23:21:58 +08:00
parent 190d5e1ece
commit 3288624cf2

View File

@@ -125,7 +125,7 @@ func (auth *UserPassAuth) PostAuthCallbackHandler(w http.ResponseWriter, r *http
return return
} }
SetTokenCookie(w, r, auth.TokenCookieName(), token, auth.tokenTTL) 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) { func (auth *UserPassAuth) LoginHandler(w http.ResponseWriter, r *http.Request) {