fix(workbench): keep auth transient failures off login redirect (#1924)
This commit is contained in:
@@ -24,6 +24,13 @@ export const useAuthStore = defineStore("auth", () => {
|
||||
document.body.dataset.authState = "authenticated";
|
||||
return;
|
||||
}
|
||||
const explicitUnauthenticated = current.status === 401 || current.status === 403 || (current.ok && current.data?.authenticated === false);
|
||||
if (!explicitUnauthenticated) {
|
||||
error.value = current.error || "认证状态暂时不可达,保持当前页面并稍后重试。";
|
||||
checked.value = authState.value === "authenticated";
|
||||
document.body.dataset.authState = authState.value === "authenticated" ? "authenticated" : "checking";
|
||||
return;
|
||||
}
|
||||
session.value = null;
|
||||
authState.value = "login";
|
||||
checked.value = true;
|
||||
|
||||
Reference in New Issue
Block a user