From f22dacbb809bc2da1a3c9aa96f2a0d65c79c5085 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 25 Jan 2022 03:57:01 +0800 Subject: [PATCH] Prevent showing webauthn error for every time visiting `/user/settings/security` (#18385) --- web_src/js/features/user-auth-webauthn.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/web_src/js/features/user-auth-webauthn.js b/web_src/js/features/user-auth-webauthn.js index bc221d037f..cf60535d40 100644 --- a/web_src/js/features/user-auth-webauthn.js +++ b/web_src/js/features/user-auth-webauthn.js @@ -150,13 +150,12 @@ export function initUserAuthWebAuthnRegister() { return; } - if (!detectWebAuthnSupport()) { - return; - } - $('#webauthn-error').modal({allowMultiple: false}); $('#register-webauthn').on('click', (e) => { e.preventDefault(); + if (!detectWebAuthnSupport()) { + return; + } webAuthnRegisterRequest(); }); }