Browse Source

Do not show full error msg to user

devStorm 5 years ago
parent
commit
0052dad13e
2 changed files with 4 additions and 2 deletions
  1. 2 1
      app/auth/views/fido.py
  2. 2 1
      app/dashboard/views/fido_setup.py

+ 2 - 1
app/auth/views/fido.py

@@ -67,7 +67,8 @@ def fido():
             new_sign_count = webauthn_assertion_response.verify()
             new_sign_count = webauthn_assertion_response.verify()
             is_webauthn_verified = True
             is_webauthn_verified = True
         except Exception as e:
         except Exception as e:
-            flash('Key verification failed. Error: {}'.format(e), "warning")
+            LOG.error(f'An error occurred in WebAuthn verification process: {e}')
+            flash('Key verification failed.', "warning")
 
 
         if is_webauthn_verified:
         if is_webauthn_verified:
             user.fido_sign_count = new_sign_count
             user.fido_sign_count = new_sign_count

+ 2 - 1
app/dashboard/views/fido_setup.py

@@ -50,7 +50,8 @@ def fido_setup():
         try:
         try:
             fido_credential = fido_reg_response.verify()
             fido_credential = fido_reg_response.verify()
         except Exception as e:
         except Exception as e:
-            flash('Key registration failed. Error: {}'.format(e), "warning")
+            LOG.error(f'An error occurred in WebAuthn registration process: {e}')
+            flash('Key registration failed.', "warning")
             return redirect(url_for("dashboard.index"))
             return redirect(url_for("dashboard.index"))
 
 
         current_user.fido_pk = str(fido_credential.public_key, "utf-8")
         current_user.fido_pk = str(fido_credential.public_key, "utf-8")