update to new core session system

This commit is contained in:
Zeni Kim 2026-05-18 15:51:12 -05:00
parent f5ab92b1cf
commit df80e29f6e
5 changed files with 8 additions and 188 deletions

View file

@ -9,7 +9,6 @@ import (
"git.smarteching.com/goffee/core"
"git.smarteching.com/goffee/cup/models"
"git.smarteching.com/goffee/cup/utils"
"gorm.io/gorm"
)
@ -31,7 +30,7 @@ var CheckSessionCookie core.Hook = func(c *core.Context) {
} else {
userAgent := c.GetUserAgent()
hashedCacheKey := utils.CreateAuthTokenHashedCacheKey(uint(c.CastToInt(payload["userID"])), userAgent)
hashedCacheKey := core.CreateAuthTokenHashedCacheKey(uint(c.CastToInt(payload["userID"])), userAgent)
cachedToken, err := c.GetCache().Get(hashedCacheKey)
if err != nil {
@ -102,7 +101,7 @@ var AuthCheck core.Hook = func(c *core.Context) {
return
}
userAgent := c.GetUserAgent()
hashedCacheKey := utils.CreateAuthTokenHashedCacheKey(uint(c.CastToInt(payload["userID"])), userAgent)
hashedCacheKey := core.CreateAuthTokenHashedCacheKey(uint(c.CastToInt(payload["userID"])), userAgent)
cachedToken, err := c.GetCache().Get(hashedCacheKey)
if err != nil {