Skip to content

Commit 0d79093

Browse files
authored
fix(api): only classify a switchable passkey when a code method exists (#3528)
Tighten the 2FA-method classifier so 'passkey' requires a CODE-based alternative (authenticator app, SMS, or email code). A passkey / security-key prompt whose only alternative is a device approval, push, or email/SMS link is now 'other' — so the take-over panel doesn't tell the user to 'enter a code' when no code method is actually available.
1 parent 914cb1e commit 0d79093

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

‎apps/api/src/browserbase/browser-login-classifier.ts‎

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,15 @@ export async function classifyTwoFactorMethod(
122122
'user to verify, and whether another method can be chosen. Return exactly one:\n' +
123123
'"code" — a one-time / authenticator / SMS / email verification CODE can be ' +
124124
'entered right now (a code field is visible);\n' +
125-
'"passkey" — it is asking for a passkey or security key, AND there is a way to ' +
126-
"switch to another method (a 'More options', 'Try another way', or 'use a code' control);\n" +
127-
'"passkey_only" — it is asking for a passkey or security key and NO other method ' +
128-
'is offered;\n' +
129-
'"other" — a different verification (a device approval/notification, a CAPTCHA, ' +
130-
'or an email/SMS link to click).\n' +
131-
'Only choose "passkey" or "passkey_only" when the page explicitly asks for a ' +
132-
'passkey or security key; a device approval, push notification, or email/SMS ' +
133-
'link is "other".',
125+
'"passkey" — it is asking for a passkey or security key, AND a CODE-based method ' +
126+
'(an authenticator app, SMS, or email code) can be chosen instead;\n' +
127+
'"passkey_only" — it is asking for a passkey or security key with no usable ' +
128+
'alternative;\n' +
129+
'"other" — anything else, INCLUDING a passkey / security-key prompt whose only ' +
130+
'alternative is a device approval, push notification, or email/SMS LINK (not a ' +
131+
'code), and standalone CAPTCHA / device-approval / link steps.\n' +
132+
'Only "code" and "passkey" imply a code the user can enter; do not pick them ' +
133+
'unless a code can actually be entered.',
134134
z.object({
135135
method: z.enum(['code', 'passkey', 'passkey_only', 'other']),
136136
}),

0 commit comments

Comments
 (0)