diff --git a/web_src/js/features/user-auth-webauthn.ts b/web_src/js/features/user-auth-webauthn.ts index e6c37581e0..1f336b9741 100644 --- a/web_src/js/features/user-auth-webauthn.ts +++ b/web_src/js/features/user-auth-webauthn.ts @@ -11,13 +11,10 @@ export async function initUserAuthWebAuthn() { return; } - if (window.location.protocol === 'http:') { - // webauthn is only supported on secure contexts - const isLocalhost = ['localhost', '127.0.0.1'].includes(window.location.hostname); - if (!isLocalhost) { - hideElem(elSignInPasskeyBtn); - return; - } + // webauthn is only supported on secure contexts + if (!window.isSecureContext) { + hideElem(elSignInPasskeyBtn); + return; } if (!detectWebAuthnSupport()) {