Do not show full error msg to user

This commit is contained in:
devStorm 2020-05-07 02:48:56 -07:00
parent 282cbe25a3
commit 0052dad13e
No known key found for this signature in database
GPG Key ID: D52E1B66F336AC57
2 changed files with 4 additions and 2 deletions

View File

@ -67,7 +67,8 @@ def fido():
new_sign_count = webauthn_assertion_response.verify()
is_webauthn_verified = True
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:
user.fido_sign_count = new_sign_count

View File

@ -50,7 +50,8 @@ def fido_setup():
try:
fido_credential = fido_reg_response.verify()
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"))
current_user.fido_pk = str(fido_credential.public_key, "utf-8")