diff --git a/app/controllers/concerns/idv_session.rb b/app/controllers/concerns/idv_session.rb index d1a3ba07535..4d2d4fa19b7 100644 --- a/app/controllers/concerns/idv_session.rb +++ b/app/controllers/concerns/idv_session.rb @@ -43,6 +43,7 @@ def idv_attempter_throttled? def sp_context_needed? return if sp_from_sp_session.present? + return unless LoginGov::Hostdata.in_datacenter? return if LoginGov::Hostdata.env != AppConfig.env.sp_context_needed_environment redirect_to account_url diff --git a/spec/controllers/idv_controller_spec.rb b/spec/controllers/idv_controller_spec.rb index b880fc98d6e..ed74566c77f 100644 --- a/spec/controllers/idv_controller_spec.rb +++ b/spec/controllers/idv_controller_spec.rb @@ -79,6 +79,7 @@ context 'prod environment' do before do allow(LoginGov::Hostdata).to receive(:env).and_return('prod') + allow(LoginGov::Hostdata).to receive(:in_datacenter?).and_return(true) end it 'redirects back to the account page' do @@ -91,6 +92,21 @@ context 'non-prod environment' do before do allow(LoginGov::Hostdata).to receive(:env).and_return('staging') + allow(LoginGov::Hostdata).to receive(:in_datacenter?).and_return(true) + end + + it 'begins the identity proofing process' do + get :index + + expect(response).to redirect_to idv_doc_auth_url + end + end + + + context 'local development' do + before do + allow(LoginGov::Hostdata).to receive(:env).and_return(nil) + allow(LoginGov::Hostdata).to receive(:in_datacenter?).and_return(false) end it 'begins the identity proofing process' do