diff --git a/app/routes/webauthn.py b/app/routes/webauthn.py index 635c60e..699985a 100644 --- a/app/routes/webauthn.py +++ b/app/routes/webauthn.py @@ -36,7 +36,11 @@ from webauthn.helpers.structs import ( UserVerificationRequirement, AuthenticatorAttachment, ) -from webauthn.helpers.exceptions import InvalidCBORData, InvalidAuthenticatorResponse +from webauthn.helpers.exceptions import ( + InvalidCBORData, + InvalidRegistrationResponse, + InvalidAuthenticationResponse, +) from flask import Blueprint, request, jsonify, g, session, current_app from app import db, limiter, client_ip @@ -142,7 +146,7 @@ def register_complete(): expected_origin=_origins(), require_user_verification=False, ) - except (InvalidCBORData, InvalidAuthenticatorResponse, Exception) as e: + except (InvalidCBORData, InvalidRegistrationResponse, Exception) as e: return jsonify({'error': f'Registration verification failed: {str(e)}'}), 400 # Persist the new credential. @@ -385,4 +389,4 @@ def delete_credential(cred_id): ip_address=client_ip(), ) db.session.commit() - return jsonify({'message': 'Passkey removed'}), 200 + return jsonify({'message': 'Passkey removed'}), 200 \ No newline at end of file