refactor: remove gphttp.ServerError method

This commit is contained in:
yusing
2025-09-27 12:47:51 +08:00
parent 22bcf1201b
commit 5043ef778f
4 changed files with 23 additions and 37 deletions

View File

@@ -121,7 +121,8 @@ func (auth *UserPassAuth) PostAuthCallbackHandler(w http.ResponseWriter, r *http
}
token, err := auth.NewToken()
if err != nil {
gphttp.ServerError(w, r, err)
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
gphttp.LogError(r).Msg(fmt.Sprintf("failed to generate token: %v", err))
return
}
SetTokenCookie(w, r, auth.TokenCookieName(), token, auth.tokenTTL)