summaryrefslogtreecommitdiffstats
path: root/web_src
diff options
context:
space:
mode:
authorwxiaoguang <wxiaoguang@gmail.com>2022-01-25 08:11:49 +0800
committerGitHub <noreply@github.com>2022-01-25 00:11:49 +0000
commitb68e605d56ef472de597e9a7c6df406ce97028c0 (patch)
tree38a3b086036550e518eb95f7adda037841fd0deb /web_src
parent42991dc89a7f3dadb7ad3b36d18b1a74628ec272 (diff)
downloadgitea-b68e605d56ef472de597e9a7c6df406ce97028c0.tar.gz
gitea-b68e605d56ef472de597e9a7c6df406ce97028c0.zip
Prevent showing webauthn error for every time visiting `/user/settings/security` (#18385) (#18386)
Backport #18385
Diffstat (limited to 'web_src')
-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();
});
}