We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 582ad33 commit b8c2afdCopy full SHA for b8c2afd
web_src/js/features/user-auth-webauthn.ts
@@ -1,5 +1,5 @@
1
import {encodeURLEncodedBase64, decodeURLEncodedBase64} from '../utils.ts';
2
-import {showElem} from '../utils/dom.ts';
+import {hideElem, showElem} from '../utils/dom.ts';
3
import {GET, POST} from '../modules/fetch.ts';
4
5
const {appSubUrl} = window.config;
@@ -11,6 +11,15 @@ export async function initUserAuthWebAuthn() {
11
return;
12
}
13
14
+ if (window.location.protocol === 'http:') {
15
+ // webauthn is only supported on secure contexts
16
+ const isLocalhost = ['localhost', '127.0.0.1'].includes(window.location.hostname);
17
+ if (!isLocalhost) {
18
+ hideElem(elSignInPasskeyBtn);
19
+ return;
20
+ }
21
22
+
23
if (!detectWebAuthnSupport()) {
24
25
0 commit comments