Skip to content

Commit

Permalink
chore: better legacy encoding and decoding
Browse files Browse the repository at this point in the history
  • Loading branch information
joamag committed May 21, 2024
1 parent d308b61 commit 55f9627
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/appier_extras/parts/admin/models/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -820,7 +820,7 @@ def register_begin_fido2(self):

registration_data, state = fido2_server.register_begin(
dict(
id=self.username.encode("utf-8"),
id=appier.legacy.bytes(self.username, encoding="utf-8"),
name=self.username,
displayName=self.username,
),
Expand All @@ -845,11 +845,11 @@ def register_fido2(self, state, credential_data):

# converts the credential data into a Base64 encoded string
# the strings is structured in the WebAuthn standard format
credential_id_b64 = base64.b64encode(
auth_data.credential_data.credential_id
).decode("utf-8")
credential_data_b64 = base64.b64encode(auth_data.credential_data).decode(
"utf-8"
credential_id_b64 = appier.legacy.str(
base64.b64encode(auth_data.credential_data.credential_id)
)
credential_data_b64 = appier.legacy.str(
base64.b64encode(auth_data.credential_data)
)

# adds the new credential to the account effectively enabling
Expand Down

0 comments on commit 55f9627

Please sign in to comment.