05/18 Enhanced codes and functionalities 6
This commit is contained in:
@@ -36,7 +36,11 @@ from webauthn.helpers.structs import (
|
|||||||
UserVerificationRequirement,
|
UserVerificationRequirement,
|
||||||
AuthenticatorAttachment,
|
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 flask import Blueprint, request, jsonify, g, session, current_app
|
||||||
|
|
||||||
from app import db, limiter, client_ip
|
from app import db, limiter, client_ip
|
||||||
@@ -142,7 +146,7 @@ def register_complete():
|
|||||||
expected_origin=_origins(),
|
expected_origin=_origins(),
|
||||||
require_user_verification=False,
|
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
|
return jsonify({'error': f'Registration verification failed: {str(e)}'}), 400
|
||||||
|
|
||||||
# Persist the new credential.
|
# Persist the new credential.
|
||||||
|
|||||||
Reference in New Issue
Block a user