diff options
author | Matthew Miller <matthew@millerti.me> | 2023-02-08 21:20:52 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-02-08 21:20:52 -0800 |
commit | c26df4309443f11045e6ed1474812f89ee3868e7 (patch) | |
tree | 2cc5ecfa7ede5cbb11bcf9babbf512ac23ef5a94 /packages/browser/src/helpers/identifyRegistrationError.ts | |
parent | 94aaa5f35e68588b64e021695231e4690be4ec95 (diff) | |
parent | dc40f408e45fd6c8c053cc4c63e99ad96a739d39 (diff) |
Merge pull request #353 from MasterKale/fix/352-not-allowed-error
fix/352-not-allowed-error
Diffstat (limited to 'packages/browser/src/helpers/identifyRegistrationError.ts')
-rw-r--r-- | packages/browser/src/helpers/identifyRegistrationError.ts | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/packages/browser/src/helpers/identifyRegistrationError.ts b/packages/browser/src/helpers/identifyRegistrationError.ts index 8976602..9b76454 100644 --- a/packages/browser/src/helpers/identifyRegistrationError.ts +++ b/packages/browser/src/helpers/identifyRegistrationError.ts @@ -41,12 +41,10 @@ export function identifyRegistrationError({ // https://www.w3.org/TR/webauthn-2/#sctn-op-make-cred (Step 3) return new WebAuthnError('The authenticator was previously registered', 'InvalidStateError'); } else if (error.name === 'NotAllowedError') { - // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 20) - // https://www.w3.org/TR/webauthn-2/#sctn-createCredential (Step 21) - return new WebAuthnError( - 'User clicked cancel, or the registration ceremony timed out', - 'NotAllowedError', - ); + /** + * Pass the error directly through. Platforms are overloading this error beyond what the spec + * defines and we don't want to overwrite potentially useful error messages. + */ } else if (error.name === 'NotSupportedError') { const validPubKeyCredParams = publicKey.pubKeyCredParams.filter( param => param.type === 'public-key', |