From 7422a2be07e5db98aa677d64c2ef594dbf118dd1 Mon Sep 17 00:00:00 2001 From: wxiaoguang Date: Mon, 24 Jan 2022 18:32:18 +0800 Subject: [PATCH] Prevent showing webauthn error for every time visiting `/user/settings/security` --- 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 bc221d037fc94..cf60535d404d7 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(); }); }