diff --git a/app/views/users/webauthn_setup/new.html.erb b/app/views/users/webauthn_setup/new.html.erb index b1e78fd3c74..716ca4a870b 100644 --- a/app/views/users/webauthn_setup/new.html.erb +++ b/app/views/users/webauthn_setup/new.html.erb @@ -14,7 +14,7 @@ <%= simple_form_for( '', - url: webauthn_setup_path, + url: webauthn_setup_path(platform: @platform_authenticator.presence), method: :patch, html: { class: 'margin-top-4 margin-bottom-1', diff --git a/spec/features/webauthn/management_spec.rb b/spec/features/webauthn/management_spec.rb index 7436e257b1a..6b4fb55e552 100644 --- a/spec/features/webauthn/management_spec.rb +++ b/spec/features/webauthn/management_spec.rb @@ -169,6 +169,17 @@ def expect_webauthn_platform_setup_error expect(page).to have_current_path webauthn_setup_path(platform: true) + # Regression: LG-9860: Ensure that the platform URL parameter is maintained through reauthn + travel_to (IdentityConfig.store.reauthn_window + 1).seconds.from_now + fill_in_nickname_and_click_continue + mock_press_button_on_hardware_key_on_setup + + expect(page).to have_current_path login_two_factor_options_path(reauthn: true) + click_on t('forms.buttons.continue') + fill_in_code_with_last_phone_otp + click_submit_default + + expect(page).to have_current_path webauthn_setup_path(platform: true) fill_in_nickname_and_click_continue mock_press_button_on_hardware_key_on_setup