Skip to content

Commit 52c3bf7

Browse files
committed
Don't set attachment based on hints
1 parent 0e805a3 commit 52c3bf7

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

_app/homepage/services/registration.py

+1-22
Original file line numberDiff line numberDiff line change
@@ -56,28 +56,7 @@ def generate_registration_options(
5656
user_verification=UserVerificationRequirement.DISCOURAGED,
5757
resident_key=ResidentKeyRequirement.PREFERRED,
5858
)
59-
if len(hints) > 0:
60-
"""
61-
Deferring to hints when present as per https://w3c.github.io/webauthn/#enum-hints
62-
"""
63-
if hints[0] == "security-key":
64-
# "For compatibility with older user agents, when this hint is used in
65-
# PublicKeyCredentialCreationOptions, the authenticatorAttachment SHOULD be set to
66-
# cross-platform."
67-
authenticator_attachment = AuthenticatorAttachment.CROSS_PLATFORM
68-
elif hints[0] == "hybrid":
69-
# "For compatibility with older user agents, when this hint is used in
70-
# PublicKeyCredentialCreationOptions, the authenticatorAttachment SHOULD be set to
71-
# cross-platform."
72-
authenticator_attachment = AuthenticatorAttachment.CROSS_PLATFORM
73-
elif hints[0] == "client-device":
74-
# "For compatibility with older user agents, when this hint is used in
75-
# PublicKeyCredentialCreationOptions, the authenticatorAttachment SHOULD be set to
76-
# platform."
77-
authenticator_attachment = AuthenticatorAttachment.PLATFORM
78-
79-
authenticator_selection.authenticator_attachment = authenticator_attachment
80-
elif attachment != "all":
59+
if attachment != "all":
8160
authenticator_attachment = AuthenticatorAttachment.CROSS_PLATFORM
8261
if attachment == "platform":
8362
authenticator_attachment = AuthenticatorAttachment.PLATFORM

0 commit comments

Comments
 (0)