mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 16:52:45 +08:00
the protection I placed was in the wrong path moved to /session/sso
correct previous commit
This commit is contained in:
parent
5076487eaf
commit
64d9be726f
|
@ -173,7 +173,7 @@ class SessionController < ApplicationController
|
|||
end
|
||||
|
||||
# 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("/")
|
||||
end
|
||||
|
||||
|
|
|
@ -303,8 +303,8 @@ RSpec.describe SessionController do
|
|||
|
||||
end
|
||||
|
||||
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.email
|
||||
sso.external_id = 'abc'
|
||||
sso.username = 'sam'
|
||||
|
@ -312,7 +312,7 @@ RSpec.describe SessionController do
|
|||
get "/session/sso_login", params: Rack::Utils.parse_query(sso.payload), headers: headers
|
||||
expect(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.email
|
||||
sso.external_id = 'abc'
|
||||
sso.username = 'sam'
|
||||
|
|
Loading…
Reference in New Issue
Block a user