OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

navigator.credentials.get should fail if no passkey found

  • Thread starter Thread starter Whip
  • Start date Start date
W

Whip

Guest
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.

screenshot

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?

<p>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.</p>
<p>When user enters their email address to login, I check all the devices for that user and pass a challenge with <code>publicKey.allowCredentials</code> array filled with Device A's data. This is passed to <code>navigator.credentials.get</code> but as there are no passkeys, windows presents a dialog to select another device.</p>
<p><a href="https://i.sstatic.net/pz8gxafg.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/pz8gxafg.png" alt="screenshot" /></a></p>
<p>Is it possible for <code>credentials.get</code> 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?</p>
 

Latest posts

Top