From 2daa85daf3eea5111331bbde31027e2b5f1a7729 Mon Sep 17 00:00:00 2001 From: LittleSheep Date: Tue, 30 Jan 2024 23:32:21 +0800 Subject: [PATCH] :bug: Fix pickup policy picked granted session issue --- pkg/server/oauth_api.go | 7 +++---- pkg/view/src/pages/dashboard.tsx | 6 +++--- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/pkg/server/oauth_api.go b/pkg/server/oauth_api.go index 0779eec..898cbb9 100644 --- a/pkg/server/oauth_api.go +++ b/pkg/server/oauth_api.go @@ -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, diff --git a/pkg/view/src/pages/dashboard.tsx b/pkg/view/src/pages/dashboard.tsx index b1c91e1..de5e332 100644 --- a/pkg/view/src/pages/dashboard.tsx +++ b/pkg/view/src/pages/dashboard.tsx @@ -128,7 +128,7 @@ export default function DashboardPage() {
-
+
Challenges @@ -164,7 +164,7 @@ export default function DashboardPage() {
-
+
Sessions @@ -203,7 +203,7 @@ export default function DashboardPage() {
-
+
Events