feat: update
This commit is contained in:
@@ -5,7 +5,7 @@ import (
|
||||
"strings"
|
||||
"time"
|
||||
|
||||
"quyun/app/models"
|
||||
"quyun/app/model"
|
||||
"quyun/pkg/utils"
|
||||
|
||||
"github.com/gofiber/fiber/v3"
|
||||
@@ -26,7 +26,7 @@ func (f *Middlewares) Auth(ctx fiber.Ctx) error {
|
||||
}
|
||||
|
||||
if f.app.IsDevMode() && false {
|
||||
user, err := models.Users.GetByID(ctx.Context(), 1)
|
||||
user, err := model.UsersModel.GetByID(ctx.Context(), 1)
|
||||
if err != nil {
|
||||
return ctx.Send([]byte("User not found"))
|
||||
}
|
||||
@@ -66,7 +66,7 @@ func (f *Middlewares) Auth(ctx fiber.Ctx) error {
|
||||
return ctx.Redirect().To(fullUrl)
|
||||
}
|
||||
|
||||
user, err := models.Users.GetByID(ctx.Context(), jwt.UserID)
|
||||
user, err := model.UsersModel.GetByID(ctx.Context(), jwt.UserID)
|
||||
if err != nil {
|
||||
// remove cookie
|
||||
ctx.ClearCookie("token")
|
||||
|
||||
Reference in New Issue
Block a user