chore(clerk-js): Improve error handling of passkeys#3025
Conversation
🦋 Changeset detectedLatest commit: 29b05e3 The changes in this PR will be included in the next version bump. This PR includes changesets to release 13 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
!snapshot |
|
Hey @panteliselef - the snapshot version command generated the following package versions:
Tip: Use the snippet copy button below to quickly install the required packages. npm i @clerk/backend@1.0.1-snapshot.v335ba7f --save-exact
npm i @clerk/chrome-extension@1.0.1-snapshot.v335ba7f --save-exact
npm i @clerk/clerk-js@5.0.1-snapshot.v335ba7f --save-exact
npm i @clerk/clerk-expo@1.0.1-snapshot.v335ba7f --save-exact
npm i @clerk/fastify@1.0.1-snapshot.v335ba7f --save-exact
npm i gatsby-plugin-clerk@5.0.1-snapshot.v335ba7f --save-exact
npm i @clerk/localizations@2.0.1-snapshot.v335ba7f --save-exact
npm i @clerk/nextjs@5.0.1-snapshot.v335ba7f --save-exact
npm i @clerk/clerk-react@5.0.1-snapshot.v335ba7f --save-exact
npm i @clerk/remix@4.0.1-snapshot.v335ba7f --save-exact
npm i @clerk/clerk-sdk-node@5.0.1-snapshot.v335ba7f --save-exact
npm i @clerk/shared@2.0.1-snapshot.v335ba7f --save-exact
npm i @clerk/themes@2.0.1-snapshot.v335ba7f --save-exact
npm i @clerk/types@4.0.1-snapshot.v335ba7f --save-exact |
| // Generic | ||
| | 'passkey_not_supported' | ||
| | 'passkeys_pa_not_supported' | ||
| | 'passkey_invalid_rpID_or_domain' |
There was a problem hiding this comment.
should this be all lower case? or is it aligning with a code sent back from FAPI?
There was a problem hiding this comment.
FAPI also uses a lower case / snake case format. But these have nothing to do with FAPI as they will be thrown when something goes wrong when interacting with WebAuthN which is client only.
| throw new Error( | ||
| `${errorPrefix} Missing publicKey. When calling 'navigator.credentials.${name}()' it is required to pass a publicKey object.`, | ||
| ); |
There was a problem hiding this comment.
❓ Maybe we should be more descriptive of what the publicKey refers to?
There was a problem hiding this comment.
Where this function is used @panteliselef wrote // This should never occur, just a fail-safe so I'm assuming this is for handling edge cases. If this would be surfaced to the user a CTA to contact us might be helpful since we ourselves don't think they'll ever get into that state
| @@ -0,0 +1,2 @@ | |||
| --- | |||
There was a problem hiding this comment.
You'll probably want to add a changeset
Description
This PR improves the error codes from runtime errors that will be thrown when a creation or retrieval of a passkey fails.
Previous error when user exists from passkey selection.
After this PR
Checklist
npm testruns as expected.npm run buildruns as expected.Type of change