Skip to content

Commit 2a12b8f

Browse files
authored
fix: skip popup flow for Chrome iOS, use direct iframe passkey creation (#2419)
Chrome iOS (CriOS) was being routed through the popup flow due to the isSafari regex matching its user agent. However, passkey creation in Chrome iOS popups shows a 'Sign in' dialog instead of 'Create Passkey'. By excluding CriOS from the Safari regex, Chrome iOS now uses the direct iframe path (which has publickey-credentials-create permission), same as Chrome desktop.
1 parent cc1a90f commit 2a12b8f

File tree

1 file changed

+4
-1
lines changed
  • packages/keychain/src/components/connect/create/webauthn

1 file changed

+4
-1
lines changed

packages/keychain/src/components/connect/create/webauthn/index.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,10 @@ export function useWebauthnAuthentication() {
1515
if (!chainId) throw new Error("No chainId found");
1616

1717
// Signup flow
18-
const isSafari = /^((?!chrome|android).)*safari/i.test(
18+
// Only Safari needs the popup flow for passkey creation in cross-origin iframes.
19+
// Chrome iOS (CriOS) uses WebKit like Safari but handles popups differently,
20+
// so we let it use the direct iframe path (which has publickey-credentials-create permission).
21+
const isSafari = /^((?!chrome|android|crios).)*safari/i.test(
1922
navigator.userAgent,
2023
);
2124

0 commit comments

Comments
 (0)