From 415d0c7ab2f09c6d8fa2ce4e466ebfb2107601ce Mon Sep 17 00:00:00 2001 From: Livio Amstutz Date: Sat, 2 Oct 2021 12:26:03 +0200 Subject: [PATCH] fix: webauthn support check (#2450) --- internal/ui/login/static/resources/scripts/webauthn.js | 2 +- internal/ui/login/static/templates/mfa_init_u2f.html | 3 +-- internal/ui/login/static/templates/mfa_verification_u2f.html | 2 +- internal/ui/login/static/templates/passwordless.html | 2 +- .../ui/login/static/templates/passwordless_registration.html | 3 +-- 5 files changed, 5 insertions(+), 7 deletions(-) diff --git a/internal/ui/login/static/resources/scripts/webauthn.js b/internal/ui/login/static/resources/scripts/webauthn.js index 716c61f8dc..e333c819c9 100644 --- a/internal/ui/login/static/resources/scripts/webauthn.js +++ b/internal/ui/login/static/resources/scripts/webauthn.js @@ -1,7 +1,7 @@ function checkWebauthnSupported(button, func) { let support = document.getElementsByClassName("wa-support"); let noSupport = document.getElementsByClassName("wa-no-support"); - if (typeof (PublicKeyCredential) === undefined) { + if (!window.PublicKeyCredential) { for (let item of noSupport) { item.classList.remove('hidden'); } diff --git a/internal/ui/login/static/templates/mfa_init_u2f.html b/internal/ui/login/static/templates/mfa_init_u2f.html index 5e47d8f2ba..7d6013d113 100644 --- a/internal/ui/login/static/templates/mfa_init_u2f.html +++ b/internal/ui/login/static/templates/mfa_init_u2f.html @@ -18,7 +18,7 @@
-
+ @@ -46,4 +46,3 @@ {{template "main-bottom" .}} - \ No newline at end of file diff --git a/internal/ui/login/static/templates/mfa_verification_u2f.html b/internal/ui/login/static/templates/mfa_verification_u2f.html index 9e3041e436..e0f2ba8433 100644 --- a/internal/ui/login/static/templates/mfa_verification_u2f.html +++ b/internal/ui/login/static/templates/mfa_verification_u2f.html @@ -16,7 +16,7 @@ - +