I’m here talking about a scenario when a user has already signed up with passkey and now using another device to login to their account. I saved their credential_id and public_key in the database for Device A but there is no passkey on Device B.
When user enters their email address to login, I check all the devices for that user and pass a challenge with publicKey.allowCredentials
array filled with Device A’s data. This is passed to navigator.credentials.get
but as there are no passkeys, windows presents a dialog to select another device.
Is it possible for credentials.get
to throw an error instead, saying no passkey was found ? I want to handle the case differently. Or is there another method that could check if any of the public keys I have is present on the device?