refactor(auth): change PostAuthCallbackHandler to redirect after successful authentication

This commit is contained in:
yusing
2025-09-04 06:42:18 +08:00
parent 99a6bf28e6
commit a1cd755597

View File

@@ -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) {