Pre-selecting specific passkeys using the allowCredentials property
If the user is already logged into their account, or they have presented a username/email in a two-step login flow, you can help them out by preselecting the passkey they should use to authenticate.
const allowCredentials = await lookupUserPasskeys(user.id);
const result = await passlock.authorizePasskeyAuthentication({ allowCredentials,});
// alternatively pass the userId// Passlock will look up the passkeys for youconst result = await passlock.authorizePasskeyAuthentication({ userId: user.id,});Given that you already know the user ID (or claimed ID), you can look up the passkeys associated with the account and pass them to authorizePasskeyAuthentication via the allowCredentials property. As a shortcut, you can also pass the userId property instead, which Passlock will use to look up the passkeys for you.
This is conceptually similar to the excludeCredentials registration option.
Handling missing device passkeys
Section titled “Handling missing device passkeys”A user may have deleted a passkey on their device, but it’s still linked in your app. When you pass the missing passkey ID via allowCredentials, the user’s device will adopt the roaming authenticator flow, assuming the passkey exists on a different device.