修复第三方登录旧响应覆盖新会话并补充跨标签回归

This commit is contained in:
cieanyau committed 2026-11-07 01:05:45 +08:00
1 parent 30415593a6
commit c3467875c6
6 files changed
+484 -25

No files matched your search

+1 -1
View File
@@ -20,7 +20,7 @@ export default defineNuxtPlugin({
// Read the latest value: several storage events may already be queued.
const persisted = localStorage.getItem("jwt");
if (persisted === auth.token) return;
if (isValidJwt(persisted)) auth.loginWithJwt(persisted);
if (isValidJwt(persisted)) auth.prepareLogin().commit(persisted);
else auth.clear();
const route = router.currentRoute.value;
if (!auth.isLoggedIn && !isPublicRoute(route)) {