Skip to content

Commit 8f9cace

Browse files
committed
Don't set attachment based on hints
1 parent fad5eb3 commit 8f9cace

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

0 commit comments

Comments
 (0)