fix(e2e): stabilize authenticated unlock flows

This commit is contained in:
Codex
2026-07-22 16:53:09 +08:00
parent 8bd67b83c5
commit e813333607
16 changed files with 116 additions and 28 deletions
+3 -1
View File
@@ -34,14 +34,15 @@ export function ChatAuthSync() {
const sessionKey = authState.loginStatus;
if (prevSessionKeyRef.current === sessionKey) return;
prevSessionKeyRef.current = sessionKey;
if (authState.loginStatus === "notLoggedIn") {
prevSessionKeyRef.current = sessionKey;
chatDispatch({ type: "ChatLogout" });
return;
}
if (authState.loginStatus === "guest") {
prevSessionKeyRef.current = sessionKey;
chatDispatch({ type: "ChatGuestLogin" });
return;
}
@@ -50,6 +51,7 @@ export function ChatAuthSync() {
void (async () => {
const tokenR = await AuthStorage.getInstance().getLoginToken();
if (!cancelled && tokenR.success && tokenR.data) {
prevSessionKeyRef.current = sessionKey;
chatDispatch({
type: "ChatUserLogin",
token: tokenR.data,