Skip to content

Commit

Permalink
fix: fixes "Safari is throwing Document not focused on register #5"
Browse files Browse the repository at this point in the history
closes #5
  • Loading branch information
hugomrdias committed May 18, 2023
1 parent baa9ed6 commit 3d0b2ad
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions packages/odd-passkeys/src/auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,13 @@ async function registerPasskey(username, storage, config) {
},
})

if (credential.clientExtensionResults.prf?.enabled === false) {
throw new Error('PRF not supported.')
if (
!credential.clientExtensionResults.prf ||
credential.clientExtensionResults.prf?.enabled === false
) {
throw new Error(
'This browser does not support the Webauthn extensions (PRF) needed for this demo.'
)
}

await set('passkeys', [credential])
Expand Down

0 comments on commit 3d0b2ad

Please sign in to comment.