From 8f9caceb33ae4ab5955f0a5e5a18ef6332a9a6c5 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 2c93348..d78e5c3 100644 --- a/_app/homepage/services/registration.py +++ b/_app/homepage/services/registration.py @@ -55,28 +55,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