🐛 Fix pickup policy picked granted session issue
All checks were successful
release-nightly / build-docker (push) Successful in 3m25s

This commit is contained in:
2024-01-30 23:32:21 +08:00
parent ecda5bd59b
commit 2daa85daf3
2 changed files with 6 additions and 7 deletions

View File

@ -26,10 +26,9 @@ func preConnect(c *fiber.Ctx) error {
var session models.AuthSession
if err := database.C.Where(&models.AuthSession{
AccountID: user.ID,
ClientID: &client.ID,
LastGrantAt: nil,
}).First(&session).Error; err == nil {
AccountID: user.ID,
ClientID: &client.ID,
}).Where("last_grant_at IS NULL").First(&session).Error; err == nil {
if session.ExpiredAt != nil && session.ExpiredAt.Unix() < time.Now().Unix() {
return c.JSON(fiber.Map{
"client": client,