Skip to content

Commit 8fe0821

Browse files
authored
Allowing username to be non-string like a phone number
Fix username encoding in PublicKeyCredentialUserEntity
2 parents 43bf689 + edb21c1 commit 8fe0821

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

passkeys/webauthn.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ def begin_registration(user, request) -> Tuple[dict, dict]:
8282
username = user.get_username()
8383
display_name = user.get_full_name() if hasattr(user, "get_full_name") else username
8484
user_entity = PublicKeyCredentialUserEntity(
85-
id=urlsafe_b64encode(username.encode("utf8")),
85+
id=urlsafe_b64encode(str(username).encode("utf8")),
8686
name=username,
8787
display_name=display_name,
8888
)

0 commit comments

Comments
 (0)