diff --git a/app/controllers/saml_sessions_controller.rb b/app/controllers/saml_sessions_controller.rb index 7eb3cb3b3f..0a85938d9a 100644 --- a/app/controllers/saml_sessions_controller.rb +++ b/app/controllers/saml_sessions_controller.rb @@ -34,9 +34,9 @@ def update_provider_details def show_office_select? [ - page_history.include?("/"), - page_history.include?(/\/\?locale=.{2}/), - Rails.configuration.x.laa_portal.mock_saml, + page_history.last(3).include?("/"), # recently seen the root path + page_history.last(3).include?(/\/\?locale=.{2}/), # recently seen the root path with a locale + ActiveRecord::Type::Boolean.new.cast(Rails.configuration.x.laa_portal.mock_saml) || false, # mock_saml is true ].any?(true) end