Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/controllers/concerns/idv_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 16 additions & 0 deletions spec/controllers/idv_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down