fix(redirect): allow other hosts when required

This commit is contained in:
Colin Darie 2023-04-27 13:21:20 +02:00
parent 33a1e0f22d
commit 61ebb27e86
No known key found for this signature in database
GPG key ID: 4FB865FDBCA4BCC4
4 changed files with 4 additions and 4 deletions

View file

@ -15,7 +15,7 @@ class AgentConnect::AgentController < ApplicationController
cookies.encrypted[STATE_COOKIE_NAME] = state
cookies.encrypted[NONCE_COOKIE_NAME] = nonce
redirect_to uri
redirect_to uri, allow_other_host: true
end
def callback

View file

@ -4,7 +4,7 @@ class FranceConnect::ParticulierController < ApplicationController
def login
if FranceConnectService.enabled?
redirect_to FranceConnectService.authorization_uri
redirect_to FranceConnectService.authorization_uri, allow_other_host: true
else
redirect_to new_user_session_path
end

View file

@ -36,7 +36,7 @@ class Users::SessionsController < Devise::SessionsController
case connected_with_france_connect
when User.loged_in_with_france_connects.fetch(:particulier)
redirect_to FRANCE_CONNECT[:particulier][:logout_endpoint]
redirect_to FRANCE_CONNECT[:particulier][:logout_endpoint], allow_other_host: true
return
end
end

View file

@ -44,7 +44,7 @@ describe Users::SessionsController, type: :controller do
end
context 'when a previous path was registered' do
let(:stored_path) { 'a_path' }
let(:stored_path) { '/a_path' }
before { controller.store_location_for(:user, stored_path) }