Skip to content

Commit d3663d7

Browse files
committed
Error dialog when WebAuthn not supported
1 parent 141b8b5 commit d3663d7

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

WebAuthn.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,11 @@ function TfaWebAuthn_addkey() {
77
var json = JSON.parse(createDataRaw);
88

99
recursiveBase64StrToArrayBuffer(json);
10+
11+
if (!window.fetch || !navigator.credentials || !navigator.credentials.create) {
12+
window.alert('Browser does not support WebAuthn.');
13+
return;
14+
}
1015

1116
navigator.credentials.create(json).then(function(f) {
1217
console.log(f);

0 commit comments

Comments
 (0)