summaryrefslogtreecommitdiffhomepage
path: root/packages/browser/src/helpers/browserSupportsWebauthn.ts
diff options
context:
space:
mode:
authorMatthew Miller <matthew@millerti.me>2021-08-23 20:18:27 -0700
committerMatthew Miller <matthew@millerti.me>2021-08-23 20:18:27 -0700
commit808256a244c6e21c2db6b29bfc0cfe24268b460c (patch)
tree849c619e3bc8e02884739a7c387e937b244fa0eb /packages/browser/src/helpers/browserSupportsWebauthn.ts
parent09c073098fc2ea506692de614d578c805b74705a (diff)
Rename supportsWebAuthn (and fix tests)
Diffstat (limited to 'packages/browser/src/helpers/browserSupportsWebauthn.ts')
-rw-r--r--packages/browser/src/helpers/browserSupportsWebauthn.ts8
1 files changed, 8 insertions, 0 deletions
diff --git a/packages/browser/src/helpers/browserSupportsWebauthn.ts b/packages/browser/src/helpers/browserSupportsWebauthn.ts
new file mode 100644
index 0000000..030256f
--- /dev/null
+++ b/packages/browser/src/helpers/browserSupportsWebauthn.ts
@@ -0,0 +1,8 @@
+/**
+ * Determine if the browser is capable of Webauthn
+ */
+export function browserSupportsWebauthn(): boolean {
+ return (
+ window?.PublicKeyCredential !== undefined && typeof window.PublicKeyCredential === 'function'
+ );
+}