Skip to content

Commit

Permalink
Update renamed function calls
Browse files Browse the repository at this point in the history
  • Loading branch information
david-venhoff committed Mar 28, 2024
1 parent b952142 commit d14ac64
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
from django.utils.translation import gettext_lazy as _
from django.views.generic import View
from webauthn import base64url_to_bytes, verify_authentication_response
from webauthn.helpers import parse_authentication_credential_json
from webauthn.helpers.exceptions import InvalidAuthenticationResponse
from webauthn.helpers.structs import AuthenticationCredential

if TYPE_CHECKING:
from django.http import HttpRequest
Expand Down Expand Up @@ -47,7 +47,9 @@ def post(self, request: HttpRequest) -> JsonResponse:

try:
authentication_verification = verify_authentication_response(
credential=AuthenticationCredential.parse_raw(request.body),
credential=parse_authentication_credential_json(
json.loads(request.body)
),
expected_challenge=base64url_to_bytes(challenge),
expected_rp_id=settings.HOSTNAME,
expected_origin=settings.BASE_URL,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
from django.utils.translation import gettext_lazy as _
from django.views.generic import CreateView
from webauthn import base64url_to_bytes, verify_registration_response
from webauthn.helpers.structs import RegistrationCredential
from webauthn.helpers import parse_registration_credential_json

from ....decorators import modify_mfa_authenticated
from ....models import FidoKey
Expand Down Expand Up @@ -53,7 +53,7 @@ def post(self, request: HttpRequest, *args: Any, **kwargs: Any) -> HttpResponse:
json_data = json.loads(request.body)

webauthn_registration_response = verify_registration_response(
credential=RegistrationCredential.parse_raw(request.body),
credential=parse_registration_credential_json(json.loads(request.body)),
expected_rp_id=settings.HOSTNAME,
expected_origin=settings.BASE_URL,
expected_challenge=base64url_to_bytes(
Expand Down

0 comments on commit d14ac64

Please sign in to comment.