aboutsummaryrefslogtreecommitdiffstats
path: root/web_src/js/features
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-01-25 03:57:01 +0800
committerGitHub <noreply@github.com>2022-01-24 14:57:01 -0500
commit9837773f0e5267297e99b7267c9f19d23d63232d (patch)
treec9f26ce86c7e9dcc7219323c02ae0a2b35d00d52 /web_src/js/features
parent5506cb92da56b7c4e69573dab5ae5b759ee57e75 (diff)
downloadgitea-9837773f0e5267297e99b7267c9f19d23d63232d.tar.gz
gitea-9837773f0e5267297e99b7267c9f19d23d63232d.zip
Prevent showing webauthn error for every time visiting `/user/settings/security` (#18385)
Diffstat (limited to 'web_src/js/features')
-rw-r--r--web_src/js/features/user-auth-webauthn.js7
1 files 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();
});
}