From bb8b1449e158221f382f7138a5093b6f41653f2e Mon Sep 17 00:00:00 2001 From: Orion Date: Fri, 7 Aug 2026 11:39:55 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20=E4=BF=9D=E7=95=99=E5=B7=B2?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E7=9A=84=E5=90=8E=E5=8F=B0=E4=BC=9A=E8=AF=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/composables/useAdminSession.ts | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/composables/useAdminSession.ts b/src/composables/useAdminSession.ts index 9333146..f120f4d 100644 --- a/src/composables/useAdminSession.ts +++ b/src/composables/useAdminSession.ts @@ -9,8 +9,13 @@ export function useAdminSession() { try { const response = await AuthService.verifyToken() - if (response.code === 200 && response.detail?.token) { - adminStore.login(response.detail) + // The current stored bearer token is what was just verified by the server. + // Do not redirect a valid session merely because an adapter omits a token + // field in the verification payload; only replace it when one is supplied. + if (response.code === 200) { + if (response.detail?.token) { + adminStore.login(response.detail) + } return true } } catch {