diff options
author | Matthew Miller <matthew@millerti.me> | 2023-09-28 08:17:00 -0700 |
---|---|---|
committer | Matthew Miller <matthew@millerti.me> | 2023-09-28 08:17:00 -0700 |
commit | ffc388c5a692a5b35ba3aea6770382ac5d230cc4 (patch) | |
tree | cde9b529c1f0924f10a3b7f6597ddd155f8a7b89 /packages/browser/src/methods | |
parent | a71c6b34e65c82b17a562bf207eac28523f9ee1a (diff) |
Visibly warn when we can encourage positive change
Diffstat (limited to 'packages/browser/src/methods')
-rw-r--r-- | packages/browser/src/methods/startRegistration.ts | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/packages/browser/src/methods/startRegistration.ts b/packages/browser/src/methods/startRegistration.ts index 9f4a104..2ad3089 100644 --- a/packages/browser/src/methods/startRegistration.ts +++ b/packages/browser/src/methods/startRegistration.ts @@ -70,7 +70,7 @@ export async function startRegistration( try { responsePublicKeyAlgorithm = response.getPublicKeyAlgorithm(); } catch (error) { - // pass + warnOnBrokenImplementation('getPublicKeyAlgorithm()', error as Error); } } @@ -82,7 +82,7 @@ export async function startRegistration( responsePublicKey = bufferToBase64URLString(_publicKey); } } catch (error) { - // pass + warnOnBrokenImplementation('getPublicKey()', error as Error); } } @@ -94,7 +94,7 @@ export async function startRegistration( response.getAuthenticatorData(), ); } catch (error) { - // pass + warnOnBrokenImplementation('getAuthenticatorData()', error as Error); } } @@ -116,3 +116,14 @@ export async function startRegistration( ), }; } + +/** + * Visibly warn when we detect an issue related to a passkey provider intercepting WebAuthn API + * calls + */ +function warnOnBrokenImplementation(methodName: string, cause: Error): void { + console.warn( + `The browser extension that intercepted this WebAuthn API call incorrectly implemented ${methodName}. You should report this error to them.\n`, + cause, + ); +} |