summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/methods/startRegistration.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/browser/src/methods/startRegistration.ts')
-rw-r--r--packages/browser/src/methods/startRegistration.ts17
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,
+ );
+}