From b68e605d56ef472de597e9a7c6df406ce97028c0 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Tue, 25 Jan 2022 08:11:49 +0800 Subject: [PATCH] Prevent showing webauthn error for every time visiting `/user/settings/security` (#18385) (#18386) Backport #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(); }); }