]> source.dussan.org Git - gitea.git/commitdiff
Fix U2F error reasons always hidden (#16327)
authorStephen Holdaway <stecman@gmail.com>
Sat, 3 Jul 2021 08:19:38 +0000 (20:19 +1200)
committerGitHub <noreply@github.com>
Sat, 3 Jul 2021 08:19:38 +0000 (09:19 +0100)
This strict equality check in `u2fError` was causing the error
description to hide immediately after showing. `Object.keys`
always returns strings, but `errorType` argument is usually a
number type.

Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Co-authored-by: zeripath <art27@cantab.net>
web_src/js/index.js

index 0b5ac493ed6a87cb356549bdfb89e0ce43ca19c5..fc46a2e694bd06d5b564ff38147e8b49a734ceae 100644 (file)
@@ -2421,7 +2421,7 @@ function u2fError(errorType) {
   u2fErrors[errorType].removeClass('hide');
 
   Object.keys(u2fErrors).forEach((type) => {
-    if (type !== errorType) {
+    if (type !== `${errorType}`) {
       u2fErrors[type].addClass('hide');
     }
   });