diff --git a/app/controllers/two_factor_authentication/sms_opt_in_controller.rb b/app/controllers/two_factor_authentication/sms_opt_in_controller.rb index b0de5b8a0eb..0709f3a8aa0 100644 --- a/app/controllers/two_factor_authentication/sms_opt_in_controller.rb +++ b/app/controllers/two_factor_authentication/sms_opt_in_controller.rb @@ -73,7 +73,7 @@ def cancel_url if user_fully_authenticated? account_path elsif decorated_sp_session.sp_name - return_to_sp_cancel_path + return_to_sp_cancel_path(step: :sms_opt_in) else sign_out_path end diff --git a/app/views/devise/sessions/_return_to_service_provider.html.erb b/app/views/devise/sessions/_return_to_service_provider.html.erb index 03bbc9b2248..ce521bbeb67 100644 --- a/app/views/devise/sessions/_return_to_service_provider.html.erb +++ b/app/views/devise/sessions/_return_to_service_provider.html.erb @@ -1,4 +1,4 @@ <%= link_to( "‹ #{t('links.back_to_sp', sp: decorated_sp_session.sp_name)}", - return_to_sp_cancel_path, + return_to_sp_cancel_path(step: :authentication), ) %> diff --git a/app/views/idv/by_mail/letter_enqueued/show.html.erb b/app/views/idv/by_mail/letter_enqueued/show.html.erb index 3922a682d29..6017103e5b6 100644 --- a/app/views/idv/by_mail/letter_enqueued/show.html.erb +++ b/app/views/idv/by_mail/letter_enqueued/show.html.erb @@ -36,7 +36,7 @@ <% if decorated_sp_session.sp_name.present? %> <%= link_to( t('idv.cancel.actions.exit', app_name: APP_NAME), - return_to_sp_cancel_path(location: :come_back_later), + return_to_sp_cancel_path(step: :get_a_letter, location: :come_back_later), class: 'usa-button usa-button--big usa-button--wide', ) %> <% else %> diff --git a/app/views/idv/phone_errors/failure.html.erb b/app/views/idv/phone_errors/failure.html.erb index 526da33f467..81ec17e66c3 100644 --- a/app/views/idv/phone_errors/failure.html.erb +++ b/app/views/idv/phone_errors/failure.html.erb @@ -42,6 +42,6 @@ <% end %> <% end %> <%= render PageFooterComponent.new do %> - <%= link_to(t('links.cancel'), idv_cancel_path) %> + <%= link_to(t('links.cancel'), idv_cancel_path(step: :phone_error)) %> <% end %> diff --git a/app/views/idv/session_errors/warning.html.erb b/app/views/idv/session_errors/warning.html.erb index 5834b6c91b3..723475492eb 100644 --- a/app/views/idv/session_errors/warning.html.erb +++ b/app/views/idv/session_errors/warning.html.erb @@ -13,5 +13,5 @@ <% end %> <%= render PageFooterComponent.new do %> - <%= link_to t('links.cancel'), idv_cancel_path %> + <%= link_to t('links.cancel'), idv_cancel_path(step: :invalid_session) %> <% end %> diff --git a/app/views/idv/shared/_document_capture.html.erb b/app/views/idv/shared/_document_capture.html.erb index 6ca5755bbff..fb737b2b7de 100644 --- a/app/views/idv/shared/_document_capture.html.erb +++ b/app/views/idv/shared/_document_capture.html.erb @@ -25,7 +25,7 @@ acuant_version: acuant_version, sp_name: sp_name, flow_path: flow_path, - cancel_url: idv_cancel_path, + cancel_url: idv_cancel_path(step: :document_capture), failure_to_proof_url: failure_to_proof_url, idv_in_person_url: (IdentityConfig.store.in_person_doc_auth_button_enabled && Idv::InPersonConfig.enabled_for_issuer?(decorated_sp_session.sp_issuer)) ? idv_in_person_url : nil, security_and_privacy_how_it_works_url: MarketingSite.security_and_privacy_how_it_works_url, diff --git a/app/views/idv/unavailable/show.html.erb b/app/views/idv/unavailable/show.html.erb index 0bbf62201da..b7aeb836d44 100644 --- a/app/views/idv/unavailable/show.html.erb +++ b/app/views/idv/unavailable/show.html.erb @@ -30,7 +30,7 @@ <% c.with_action_button( action: ->(**tag_options, &block) do link_to( - return_to_sp_failure_to_proof_path(location: :unavailable), + return_to_sp_failure_to_proof_path(step: :unavailable, location: :unavailable), **tag_options, &block ) diff --git a/app/views/sign_up/completions/show.html.erb b/app/views/sign_up/completions/show.html.erb index a4cfdf5ba3f..0e1290ce7d1 100644 --- a/app/views/sign_up/completions/show.html.erb +++ b/app/views/sign_up/completions/show.html.erb @@ -29,5 +29,5 @@ <% end %> <%= render PageFooterComponent.new do %> - <%= link_to t('links.cancel'), return_to_sp_cancel_path %> + <%= link_to t('links.cancel'), return_to_sp_cancel_path(step: :sign_up) %> <% end %> diff --git a/spec/controllers/two_factor_authentication/sms_opt_in_controller_spec.rb b/spec/controllers/two_factor_authentication/sms_opt_in_controller_spec.rb index 1ee9d7e80d2..6b93bd08245 100644 --- a/spec/controllers/two_factor_authentication/sms_opt_in_controller_spec.rb +++ b/spec/controllers/two_factor_authentication/sms_opt_in_controller_spec.rb @@ -47,7 +47,7 @@ it 'points the cancel link back to the SP' do action - expect(assigns[:cancel_url]).to eq(return_to_sp_cancel_path) + expect(assigns[:cancel_url]).to eq(return_to_sp_cancel_path(step: :sms_opt_in)) end end end diff --git a/spec/features/idv/doc_auth/redo_document_capture_spec.rb b/spec/features/idv/doc_auth/redo_document_capture_spec.rb index 7e3eea50122..18431c01425 100644 --- a/spec/features/idv/doc_auth/redo_document_capture_spec.rb +++ b/spec/features/idv/doc_auth/redo_document_capture_spec.rb @@ -108,10 +108,9 @@ it 'shows a troubleshooting option to allow the user to cancel and return to SP' do click_idv_continue - expect(page).to have_link( t('links.cancel'), - href: idv_cancel_path, + href: idv_cancel_path(step: :invalid_session), ) click_link t('links.cancel') diff --git a/spec/features/openid_connect/openid_connect_spec.rb b/spec/features/openid_connect/openid_connect_spec.rb index ffe97872183..c148167aba8 100644 --- a/spec/features/openid_connect/openid_connect_spec.rb +++ b/spec/features/openid_connect/openid_connect_spec.rb @@ -772,7 +772,10 @@ expect(page).to have_content(sp_content) expect(page).to have_link( - t('links.back_to_sp', sp: 'Example iOS App'), href: return_to_sp_cancel_path + t( + 'links.back_to_sp', + sp: 'Example iOS App', + ), href: return_to_sp_cancel_path(step: :authentication) ) sign_up_user_from_sp_without_confirming_email(email) @@ -835,9 +838,11 @@ context 'going back to the SP' do it 'links back to the SP from the sign in page' do visit_idp_from_ial1_oidc_sp(prompt: 'select_account') - expect(page).to have_link( - "‹ #{t('links.back_to_sp', sp: 'Test SP')}", href: return_to_sp_cancel_path + "‹ #{t( + 'links.back_to_sp', + sp: 'Test SP', + )}", href: return_to_sp_cancel_path(step: :authentication) ) end end diff --git a/spec/features/saml/ial1_sso_spec.rb b/spec/features/saml/ial1_sso_spec.rb index 759a01e5f11..af747adb3c8 100644 --- a/spec/features/saml/ial1_sso_spec.rb +++ b/spec/features/saml/ial1_sso_spec.rb @@ -64,9 +64,11 @@ it 'shows user the start page with a link back to the SP' do visit saml_authn_request_url - expect(page).to have_link( - t('links.back_to_sp', sp: 'Your friendly Government Agency'), href: return_to_sp_cancel_path + t( + 'links.back_to_sp', + sp: 'Your friendly Government Agency', + ), href: return_to_sp_cancel_path(step: :authentication) ) end diff --git a/spec/features/saml/ial2_sso_spec.rb b/spec/features/saml/ial2_sso_spec.rb index acf814f1716..f9e89425e20 100644 --- a/spec/features/saml/ial2_sso_spec.rb +++ b/spec/features/saml/ial2_sso_spec.rb @@ -69,7 +69,10 @@ def sign_out_user visit saml_authn_request_url expect(page).to have_link( - t('links.back_to_sp', sp: 'Your friendly Government Agency'), href: return_to_sp_cancel_path + t( + 'links.back_to_sp', + sp: 'Your friendly Government Agency', + ), href: return_to_sp_cancel_path(step: :authentication) ) end end diff --git a/spec/features/saml/redirect_uri_validation_spec.rb b/spec/features/saml/redirect_uri_validation_spec.rb index cba31a0b8b9..1677f6c0eac 100644 --- a/spec/features/saml/redirect_uri_validation_spec.rb +++ b/spec/features/saml/redirect_uri_validation_spec.rb @@ -13,9 +13,9 @@ state: '123abc', ) sp = ServiceProvider.find_by(issuer: 'http://localhost:3000') - expect(page). - to have_link t('links.back_to_sp', sp: sp.friendly_name), href: return_to_sp_cancel_path + to have_link t('links.back_to_sp', sp: sp.friendly_name), + href: return_to_sp_cancel_path(step: :authentication) fill_in_credentials_and_submit(user.email, user.password) fill_in_code_with_last_phone_otp diff --git a/spec/features/saml/saml_spec.rb b/spec/features/saml/saml_spec.rb index 984c6c60a59..5cb5a3c1a84 100644 --- a/spec/features/saml/saml_spec.rb +++ b/spec/features/saml/saml_spec.rb @@ -15,7 +15,8 @@ it 'returns the user to the acs url after authentication' do expect(page). - to have_link t('links.back_to_sp', sp: sp.friendly_name), href: return_to_sp_cancel_path + to have_link t('links.back_to_sp', sp: sp.friendly_name), + href: return_to_sp_cancel_path(step: :authentication) sign_in_via_branded_page(user) click_submit_default @@ -35,7 +36,8 @@ it 'returns the user to the account page after authentication' do expect(page). - to have_link t('links.back_to_sp', sp: sp.friendly_name), href: return_to_sp_cancel_path + to have_link t('links.back_to_sp', sp: sp.friendly_name), + href: return_to_sp_cancel_path(step: :authentication) sign_in_via_branded_page(user) click_submit_default diff --git a/spec/views/devise/sessions/new.html.erb_spec.rb b/spec/views/devise/sessions/new.html.erb_spec.rb index b85fdc8ee54..7a340d4108a 100644 --- a/spec/views/devise/sessions/new.html.erb_spec.rb +++ b/spec/views/devise/sessions/new.html.erb_spec.rb @@ -111,7 +111,10 @@ render expect(rendered).to have_link( - t('links.back_to_sp', sp: 'Awesome Application!'), href: return_to_sp_cancel_path + t( + 'links.back_to_sp', + sp: 'Awesome Application!', + ), href: return_to_sp_cancel_path(step: :authentication) ) end diff --git a/spec/views/idv/by_mail/letter_enqueued/show.html.erb_spec.rb b/spec/views/idv/by_mail/letter_enqueued/show.html.erb_spec.rb index 183a0b5e71d..2b5557744e5 100644 --- a/spec/views/idv/by_mail/letter_enqueued/show.html.erb_spec.rb +++ b/spec/views/idv/by_mail/letter_enqueued/show.html.erb_spec.rb @@ -16,7 +16,7 @@ render expect(rendered).to have_link( t('idv.cancel.actions.exit', app_name: APP_NAME), - href: return_to_sp_cancel_path(location: :come_back_later), + href: return_to_sp_cancel_path(step: :get_a_letter, location: :come_back_later), ) end diff --git a/spec/views/idv/phone_errors/failure.html.erb_spec.rb b/spec/views/idv/phone_errors/failure.html.erb_spec.rb index 1e9820a57e0..83c3c33f010 100644 --- a/spec/views/idv/phone_errors/failure.html.erb_spec.rb +++ b/spec/views/idv/phone_errors/failure.html.erb_spec.rb @@ -40,7 +40,7 @@ it 'renders a cancel link' do expect(rendered).to have_link( t('links.cancel'), - href: idv_cancel_path, + href: idv_cancel_path(step: :phone_error), ) end diff --git a/spec/views/idv/session_errors/warning.html.erb_spec.rb b/spec/views/idv/session_errors/warning.html.erb_spec.rb index 4d71bea1317..61471ad97af 100644 --- a/spec/views/idv/session_errors/warning.html.erb_spec.rb +++ b/spec/views/idv/session_errors/warning.html.erb_spec.rb @@ -30,7 +30,10 @@ end it 'shows a cancel link' do - expect(rendered).to have_link(t('links.cancel'), href: idv_cancel_path) + expect(rendered).to have_link( + t('links.cancel'), + href: idv_cancel_path(step: :invalid_session), + ) end context 'with a nil user_session' do @@ -43,7 +46,10 @@ t('idv.warning.attempts_html', count: remaining_attempts), ), ) - expect(rendered).to have_link(t('links.cancel'), href: idv_cancel_path) + expect(rendered).to have_link( + t('links.cancel'), + href: idv_cancel_path(step: :invalid_session), + ) end end end diff --git a/spec/views/idv/unavailable/show.html.erb_spec.rb b/spec/views/idv/unavailable/show.html.erb_spec.rb index bcc19508635..0dedec5d104 100644 --- a/spec/views/idv/unavailable/show.html.erb_spec.rb +++ b/spec/views/idv/unavailable/show.html.erb_spec.rb @@ -34,7 +34,7 @@ it 'links to the right place' do expect(rendered).to have_link( t('idv.unavailable.exit_button', app_name: APP_NAME), - href: return_to_sp_failure_to_proof_path(location: 'unavailable'), + href: return_to_sp_failure_to_proof_path(step: 'unavailable', location: 'unavailable'), ) end end diff --git a/spec/views/sign_up/completions/show.html.erb_spec.rb b/spec/views/sign_up/completions/show.html.erb_spec.rb index 6e5d66d3fcb..facb9629633 100644 --- a/spec/views/sign_up/completions/show.html.erb_spec.rb +++ b/spec/views/sign_up/completions/show.html.erb_spec.rb @@ -55,7 +55,7 @@ render expect(rendered).to have_link( t('links.cancel'), - href: return_to_sp_cancel_path, + href: return_to_sp_cancel_path(step: :sign_up), ) end