diff --git a/ee/app/views/shared/dashboard/_saml_reauth_notice.html.haml b/ee/app/views/shared/dashboard/_saml_reauth_notice.html.haml index 47bc4bcecc739d40ca85c8711ef6284a30bfb82f..f9d9097a89b0f454a2fb0e84f7be8c298a0b56f2 100644 --- a/ee/app/views/shared/dashboard/_saml_reauth_notice.html.haml +++ b/ee/app/views/shared/dashboard/_saml_reauth_notice.html.haml @@ -6,5 +6,5 @@ - c.with_actions do .gl-display-flex.gl-flex-wrap - groups_requiring_saml_reauth.each do |group| - = render Pajamas::ButtonComponent.new(href: sso_group_saml_providers_path(group, { token: group.saml_discovery_token, redirect: dashboard_todos_path }), button_options: { class: "gl-mr-3 gl-mb-3" }) do + = render Pajamas::ButtonComponent.new(href: sso_group_saml_providers_path(group, { token: group.saml_discovery_token, redirect: url_for }), button_options: { class: "gl-mr-3 gl-mb-3" }) do = group.path diff --git a/ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb b/ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb index 8ef0f3fa83206361e94e091c4281317a278f172c..93e6ddccf4e8226323eb563e664ec57bfcc5b21e 100644 --- a/ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb +++ b/ee/spec/support/shared_examples/features/dashboard_saml_reauth_banner_shared_examples.rb @@ -26,7 +26,9 @@ s_('GroupSAML|Some items may be hidden because your SAML session has expired. Select the group’s path to reauthenticate and view any hidden items.') # rubocop:disable Layout/LineLength -- Single string ) - expect(page).to have_link(restricted_group.path, href: /#{sso_group_saml_providers_path(restricted_group)}/) + link = page.find_link(restricted_group.path) + expect(link[:href]).to start_with(sso_group_saml_providers_path(restricted_group)) + expect(link[:href]).to include("redirect=#{ERB::Util.url_encode(page_path)}") end end