feat: 添加登录入口触发器检测逻辑,增强登录状态识别

This commit is contained in:
QLHazyCoder
2026-04-26 14:03:19 +08:00
parent b520711b0a
commit ccad06332e
2 changed files with 116 additions and 0 deletions
+13
View File
@@ -96,6 +96,10 @@ function findOneTimeCodeLoginTrigger() {
return ${JSON.stringify(overrides.switchTrigger || null)};
}
function findLoginEntryTrigger() {
return ${JSON.stringify(overrides.loginEntryTrigger || null)};
}
function getLoginSubmitButton() {
return ${JSON.stringify(overrides.submitButton || null)};
}
@@ -226,6 +230,15 @@ return {
assert.strictEqual(snapshot.state, 'oauth_consent_page', '第六步应保留 oauth_consent_page 状态');
}
{
const api = createApi({
loginEntryTrigger: { id: 'continue-email' },
});
const snapshot = api.inspectLoginAuthState();
assert.strictEqual(snapshot.state, 'entry_page');
}
assert.ok(
extractFunction('inspectLoginAuthState').includes("state: 'oauth_consent_page'"),
'inspectLoginAuthState 应产出 oauth_consent_page 状态'