feat: add phone verification flow support

This commit is contained in:
sh2001sh
2026-04-20 17:39:01 +08:00
parent d85f7feaef
commit b098726a6f
13 changed files with 2001 additions and 21 deletions
+12 -9
View File
@@ -238,7 +238,7 @@ test('verification flow clears 2925 mailbox before polling and after successful
assert.deepStrictEqual(mailMessages, ['DELETE_ALL_EMAILS', 'POLL_EMAIL', 'DELETE_ALL_EMAILS']);
});
test('verification flow treats add-phone after login code submit as fatal instead of completing step 8', async () => {
test('verification flow completes step 8 and flags phone verification when add-phone appears after login code submit', async () => {
const events = [];
const helpers = api.createVerificationFlowHelpers({
@@ -288,18 +288,21 @@ test('verification flow treats add-phone after login code submit as fatal instea
VERIFICATION_POLL_MAX_ROUNDS: 5,
});
await assert.rejects(
() => helpers.resolveVerificationStep(
8,
{ email: 'user@example.com', lastLoginCode: null },
{ provider: 'qq', label: 'QQ 邮箱' },
{}
),
/验证码提交后页面进入手机号页面/
const result = await helpers.resolveVerificationStep(
8,
{ email: 'user@example.com', lastLoginCode: null },
{ provider: 'qq', label: 'QQ Mail' },
{}
);
assert.deepStrictEqual(result, {
phoneVerificationRequired: true,
url: 'https://auth.openai.com/add-phone',
});
assert.deepStrictEqual(events, [
['submit', '654321'],
['state', '654321'],
['complete', '654321'],
]);
});