A platform for community discussion. Free, open, simple.
the protection I placed was in the wrong path moved to /session/sso
Sam64d9be726f27
diff --git a/app/controllers/session_controller.rb b/app/controllers/session_controller.rbindex fbd9859e6af..fa8eecac5ac 100644--- a/app/controllers/session_controller.rb+++ b/app/controllers/session_controller.rb@@ -173,7 +173,7 @@ class SessionController < ApplicationControllerend# never redirects back to sso in an sso loop- if return_path.start_with?(path("/sso"))+ if return_path.start_with?(path("/session/sso"))return_path = path("/")enddiff --git a/spec/requests/session_controller_spec.rb b/spec/requests/session_controller_spec.rbindex 7264196a618..be90c421c26 100644--- a/spec/requests/session_controller_spec.rb+++ b/spec/requests/session_controller_spec.rb@@ -303,8 +303,8 @@ RSpec.describe SessionController doend- it 'will never redirect back to /sso path' do- sso = get_sso("/sso?bla=1")+ it 'will never redirect back to /session/sso path' do+ sso = get_sso("/session/sso?bla=1")sso.email = user.emailsso.external_id = 'abc'sso.username = 'sam'@@ -312,7 +312,7 @@ RSpec.describe SessionController doget "/session/sso_login", params: Rack::Utils.parse_query(sso.payload), headers: headersexpect(response).to redirect_to('/')- sso = get_sso("http://#{Discourse.current_hostname}/sso?bla=1")+ sso = get_sso("http://#{Discourse.current_hostname}/session/sso?bla=1")sso.email = user.emailsso.external_id = 'abc'sso.username = 'sam'