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

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

+6 -3
View File
@@ -54,9 +54,10 @@ var w = {
async function A() {
if (k && !D.value) {
((D.value = !0), (O.value = ``));
const loginAttempt = E.prepareLogin();
try {
let t = await T.get(`/oauth/token`);
if (!k) return;
if (!k || !loginAttempt.isCurrent()) return;
let n = oauth_n(
t,
window.location.origin,
@@ -68,7 +69,7 @@ var w = {
).origin,
);
if (n.kind === `login`) {
E.loginWithJwt(n.jwt);
loginAttempt.commit(n.jwt);
try {
sessionStorage.removeItem(`console-oauth-pending`);
} catch {}
@@ -79,7 +80,9 @@ var w = {
window.location.replace(n.url);
} else throw Error(`授权会话已过期,请返回登录并重新授权`);
} catch (e) {
k && (O.value = e instanceof Error ? e.message : `恢复登录失败`);
k &&
loginAttempt.isCurrent() &&
(O.value = e instanceof Error ? e.message : `恢复登录失败`);
} finally {
k && (D.value = !1);
}