修复第三方登录旧响应覆盖新会话并补充跨标签回归
This commit is contained in:
1 parent
30415593a6
commit
c3467875c6
6 files changed
+484
-25
No files matched your search
@@ -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)) {
|
||||
|
||||
Reference in new issue
Block a user