refactor: move websocket package and some http utils to seperate repo

This commit is contained in:
yusing
2025-09-27 14:16:42 +08:00
parent 6776f20332
commit 2a05c6a630
48 changed files with 52 additions and 1193 deletions

View File

@@ -8,8 +8,8 @@ import (
"github.com/golang-jwt/jwt/v5"
"github.com/yusing/godoxy/internal/common"
"github.com/yusing/godoxy/internal/net/gphttp"
gperr "github.com/yusing/goutils/errs"
httputils "github.com/yusing/goutils/http"
strutils "github.com/yusing/goutils/strings"
"golang.org/x/crypto/bcrypt"
)
@@ -122,7 +122,7 @@ func (auth *UserPassAuth) PostAuthCallbackHandler(w http.ResponseWriter, r *http
token, err := auth.NewToken()
if err != nil {
http.Error(w, "Internal Server Error", http.StatusInternalServerError)
gphttp.LogError(r).Msg(fmt.Sprintf("failed to generate token: %v", err))
httputils.LogError(r).Msg(fmt.Sprintf("failed to generate token: %v", err))
return
}
SetTokenCookie(w, r, auth.TokenCookieName(), token, auth.tokenTTL)