Skip to content

Commit

Permalink
Don't set attachment based on hints
Browse files Browse the repository at this point in the history
  • Loading branch information
MasterKale committed Dec 5, 2024
1 parent 0e805a3 commit 52c3bf7
Showing 1 changed file with 1 addition and 22 deletions.
23 changes: 1 addition & 22 deletions _app/homepage/services/registration.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,28 +56,7 @@ def generate_registration_options(
user_verification=UserVerificationRequirement.DISCOURAGED,
resident_key=ResidentKeyRequirement.PREFERRED,
)
if len(hints) > 0:
"""
Deferring to hints when present as per https://w3c.github.io/webauthn/#enum-hints
"""
if hints[0] == "security-key":
# "For compatibility with older user agents, when this hint is used in
# PublicKeyCredentialCreationOptions, the authenticatorAttachment SHOULD be set to
# cross-platform."
authenticator_attachment = AuthenticatorAttachment.CROSS_PLATFORM
elif hints[0] == "hybrid":
# "For compatibility with older user agents, when this hint is used in
# PublicKeyCredentialCreationOptions, the authenticatorAttachment SHOULD be set to
# cross-platform."
authenticator_attachment = AuthenticatorAttachment.CROSS_PLATFORM
elif hints[0] == "client-device":
# "For compatibility with older user agents, when this hint is used in
# PublicKeyCredentialCreationOptions, the authenticatorAttachment SHOULD be set to
# platform."
authenticator_attachment = AuthenticatorAttachment.PLATFORM

authenticator_selection.authenticator_attachment = authenticator_attachment
elif attachment != "all":
if attachment != "all":
authenticator_attachment = AuthenticatorAttachment.CROSS_PLATFORM
if attachment == "platform":
authenticator_attachment = AuthenticatorAttachment.PLATFORM
Expand Down

0 comments on commit 52c3bf7

Please sign in to comment.