feat: Enhance login flow with add-email and phone verification support
- Added support for the add-email page in the logging status module. - Updated step 8 to handle phone-registered accounts during email verification. - Implemented logic to submit add-email before polling for email verification codes. - Enhanced tests for step 7 to detect username input as phone number and ignore hidden inputs. - Improved step 8 to allow add-email handoff only when requested. - Updated documentation to reflect changes in the login verification flow.
This commit is contained in:
@@ -115,6 +115,37 @@ return {
|
||||
);
|
||||
});
|
||||
|
||||
test('ensureStep8VerificationPageReady allows add-email handoff only when requested', async () => {
|
||||
const api = new Function(`
|
||||
function getLoginAuthStateLabel(state) {
|
||||
return state === 'add_email_page' ? '添加邮箱页' : 'unknown page';
|
||||
}
|
||||
|
||||
async function getLoginAuthStateFromContent() {
|
||||
return {
|
||||
state: 'add_email_page',
|
||||
url: 'https://auth.openai.com/add-email',
|
||||
};
|
||||
}
|
||||
|
||||
${extractFunction(backgroundSource, 'ensureStep8VerificationPageReady')}
|
||||
|
||||
return {
|
||||
run(options) {
|
||||
return ensureStep8VerificationPageReady(options || {});
|
||||
},
|
||||
};
|
||||
`)();
|
||||
|
||||
await assert.rejects(
|
||||
() => api.run({}),
|
||||
/当前未进入登录验证码页面/
|
||||
);
|
||||
|
||||
const result = await api.run({ allowAddEmailPage: true });
|
||||
assert.equal(result.state, 'add_email_page');
|
||||
});
|
||||
|
||||
test('step 8 reruns step 7 when auth page enters login timeout retry state', async () => {
|
||||
const calls = {
|
||||
rerunStep7: 0,
|
||||
|
||||
Reference in New Issue
Block a user