From 52c3bf76afc5820d74e76405e0033976dd16b492 Mon Sep 17 00:00:00 2001 From: Matthew Miller Date: Wed, 4 Dec 2024 17:00:00 -0800 Subject: [PATCH] Don't set attachment based on hints --- _app/homepage/services/registration.py | 23 +---------------------- 1 file changed, 1 insertion(+), 22 deletions(-) diff --git a/_app/homepage/services/registration.py b/_app/homepage/services/registration.py index 0c827c0..a4157f5 100644 --- a/_app/homepage/services/registration.py +++ b/_app/homepage/services/registration.py @@ -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