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
6 changes: 2 additions & 4 deletions app/controllers/concerns/idv_step_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,9 @@ def confirm_document_capture_complete

if flow_path == 'standard'
redirect_to idv_document_capture_url
elsif flow_path == 'hybrid' &&
IdentityConfig.store.doc_auth_link_sent_controller_enabled
elsif flow_path == 'hybrid'
redirect_to idv_link_sent_url
else
flow_session.delete('Idv::Steps::DocumentCaptureStep')
else # no flow_path, go to UploadStep via FSM
redirect_to idv_doc_auth_url
end
end
Expand Down
12 changes: 1 addition & 11 deletions app/controllers/idv/doc_auth_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ class DocAuthController < ApplicationController
before_action :confirm_two_factor_authenticated
before_action :redirect_if_pending_in_person_enrollment
before_action :redirect_if_pending_profile
before_action :extend_timeout_using_meta_refresh_for_select_paths

include IdvSession
include Flow::FlowStateMachine
Expand All @@ -21,7 +20,7 @@ class DocAuthController < ApplicationController

FLOW_STATE_MACHINE_SETTINGS = {
step_url: :idv_doc_auth_step_url,
final_url: :idv_document_capture_url,
final_url: :idv_link_sent_url,
flow: Idv::Flows::DocAuthFlow,
analytics_id: 'Doc Auth',
}.freeze
Expand Down Expand Up @@ -49,15 +48,6 @@ def update_if_skipping_upload
update
end

def extend_timeout_using_meta_refresh_for_select_paths
return unless request.path == idv_doc_auth_step_path(step: :link_sent) && flow_session
max_10min_refreshes = IdentityConfig.store.doc_auth_extend_timeout_by_minutes / 10
return if max_10min_refreshes <= 0
meta_refresh_count = flow_session[:meta_refresh_count].to_i
return if meta_refresh_count >= max_10min_refreshes
do_meta_refresh(meta_refresh_count)
end

def do_meta_refresh(meta_refresh_count)
@meta_refresh = 10 * 60
flow_session[:meta_refresh_count] = meta_refresh_count + 1
Expand Down
4 changes: 0 additions & 4 deletions app/services/idv/actions/redo_document_capture_action.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ def call
redirect_to idv_document_capture_url
else
mark_step_incomplete(:upload)

if !IdentityConfig.store.doc_auth_link_sent_controller_enabled
mark_step_incomplete(:link_sent)
end
end
end
end
Expand Down
1 change: 0 additions & 1 deletion app/services/idv/flows/doc_auth_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ class DocAuthFlow < Flow::BaseFlow
welcome: Idv::Steps::WelcomeStep,
agreement: Idv::Steps::AgreementStep,
upload: Idv::Steps::UploadStep,
link_sent: Idv::Steps::LinkSentStep,
}.freeze

STEP_INDICATOR_STEPS = [
Expand Down
68 changes: 0 additions & 68 deletions app/services/idv/steps/link_sent_step.rb

This file was deleted.

5 changes: 1 addition & 4 deletions app/services/idv/steps/upload_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,7 @@ def handle_phone_submission
failure_reason: failure_reason,
)

if !failure_reason &&
IdentityConfig.store.doc_auth_link_sent_controller_enabled
if !failure_reason
flow_session[:flow_path] = 'hybrid'
redirect_to idv_link_sent_url
end
Expand All @@ -97,8 +96,6 @@ def application
end

def bypass_send_link_steps
mark_step_complete(:link_sent)

flow_session[:flow_path] = 'standard'
redirect_to idv_document_capture_url

Expand Down
1 change: 0 additions & 1 deletion config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ doc_auth_s3_request_timeout: 5
doc_auth_error_dpi_threshold: 290
doc_auth_error_glare_threshold: 40
doc_auth_error_sharpness_threshold: 40
doc_auth_link_sent_controller_enabled: false
doc_auth_max_attempts: 5
doc_auth_max_capture_attempts_before_tips: 3
doc_auth_max_capture_attempts_before_native_camera: 2
Expand Down
1 change: 0 additions & 1 deletion lib/identity_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@ def self.build_store(config_map)
config.add(:doc_auth_error_glare_threshold, type: :integer)
config.add(:doc_auth_error_sharpness_threshold, type: :integer)
config.add(:doc_auth_extend_timeout_by_minutes, type: :integer)
config.add(:doc_auth_link_sent_controller_enabled, type: :boolean)
config.add(:doc_auth_max_attempts, type: :integer)
config.add(:doc_auth_max_capture_attempts_before_native_camera, type: :integer)
config.add(:doc_auth_max_submission_attempts_before_native_camera, type: :integer)
Expand Down
18 changes: 2 additions & 16 deletions spec/controllers/idv/doc_auth_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@
it 'finishes the flow' do
get :show, params: { step: 'welcome' }

expect(response).to redirect_to idv_document_capture_url
expect(response).to redirect_to idv_link_sent_url
end
end
end
Expand Down Expand Up @@ -202,26 +202,12 @@
it 'finishes the flow' do
put :update, params: { step: 'ssn' }

expect(response).to redirect_to idv_document_capture_url
expect(response).to redirect_to idv_link_sent_url
end
end
end

def mock_next_step(step)
allow_any_instance_of(Idv::Flows::DocAuthFlow).to receive(:next_step).and_return(step)
end

let(:user) { create(:user, :fully_registered) }
let(:document_capture_session_uuid) { DocumentCaptureSession.create!(user: user).uuid }

def mock_document_capture_step
stub_sign_in(user)
allow_any_instance_of(Flow::BaseFlow).to \
receive(:flow_session).and_return(
'document_capture_session_uuid' => document_capture_session_uuid,
'Idv::Steps::WelcomeStep' => true,
'Idv::Steps::LinkSentStep' => true,
'Idv::Steps::UploadStep' => true,
)
end
end
4 changes: 0 additions & 4 deletions spec/controllers/idv/link_sent_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,7 @@
)
end

let(:feature_flag_enabled) { true }

before do
allow(IdentityConfig.store).to receive(:doc_auth_link_sent_controller_enabled).
and_return(feature_flag_enabled)
allow(subject).to receive(:flow_session).and_return(flow_session)
stub_sign_in(user)
stub_analytics
Expand Down
11 changes: 8 additions & 3 deletions spec/controllers/idv/ssn_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,6 @@
before do
flow_session[:flow_path] = 'standard'
flow_session.delete('pii_from_doc')
flow_session['Idv::Steps::DocumentCaptureStep'] = true
end

it 'redirects to DocumentCaptureController on standard flow' do
Expand All @@ -212,10 +211,16 @@
expect(response).to redirect_to idv_document_capture_url
end

it 'redirects to FSM DocumentCaptureStep on hybrid flow' do
it 'redirects to LinkSentController on hybrid flow' do
flow_session[:flow_path] = 'hybrid'
put :update
expect(flow_session['Idv::Steps::DocumentCaptureStep']).to be_nil
expect(response.status).to eq 302
expect(response).to redirect_to idv_link_sent_url
end

it 'redirects to FSM UploadStep if there is no flow_path' do
flow_session[:flow_path] = nil
put :update
expect(response.status).to eq 302
expect(response).to redirect_to idv_doc_auth_url
end
Expand Down
15 changes: 0 additions & 15 deletions spec/features/idv/actions/cancel_link_sent_action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,7 @@
include IdvStepHelper
include DocAuthHelper

let(:new_controller_enabled) { false }

before do
allow(IdentityConfig.store).to receive(:doc_auth_link_sent_controller_enabled).
and_return(new_controller_enabled)
sign_in_and_2fa_user
complete_doc_auth_steps_before_link_sent_step
end
Expand All @@ -18,15 +14,4 @@

expect(page).to have_current_path(idv_doc_auth_upload_step)
end

context 'new SendLink controller is enabled' do
let(:new_controller_enabled) { true }

it 'returns to link sent step', :js do
expect(page).to have_current_path(idv_link_sent_path)
click_doc_auth_back_link

expect(page).to have_current_path(idv_doc_auth_upload_step)
end
end
end
24 changes: 0 additions & 24 deletions spec/features/idv/actions/redo_document_capture_action_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,8 @@
include IdvStepHelper
include DocAuthHelper

let(:new_controller_enabled) { false }

context 'when barcode scan returns a warning', allow_browser_log: true do
before do
allow(IdentityConfig.store).to receive(:doc_auth_link_sent_controller_enabled).
and_return(new_controller_enabled)
sign_in_and_2fa_user
complete_doc_auth_steps_before_document_capture_step
mock_doc_auth_attention_with_barcode
Expand Down Expand Up @@ -84,25 +80,5 @@
expect(page).not_to have_css('[role="status"]')
end
end

context 'with doc_auth_link_sent_controller_enabled flag enabled',
driver: :headless_chrome_mobile do
let(:new_controller_enabled) { true }

it 'goes to document capture' do
warning_link_text = t('doc_auth.headings.capture_scan_warning_link')

expect(page).to have_css(
'[role="status"]',
text: t(
'doc_auth.headings.capture_scan_warning_html',
link: warning_link_text,
).tr(' ', ' '),
)
click_link warning_link_text

expect(current_path).to eq(idv_document_capture_path)
end
end
end
end
2 changes: 1 addition & 1 deletion spec/features/idv/doc_auth/address_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
it 'stays in FSM on hybrid flow' do
complete_doc_auth_steps_before_link_sent_step
visit(idv_address_url)
expect(page).to have_current_path(idv_doc_auth_link_sent_step)
expect(page).to have_current_path(idv_link_sent_path)
end
end
end
2 changes: 0 additions & 2 deletions spec/features/idv/doc_auth/link_sent_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@
before do
allow(FeatureManagement).
to(receive(:doc_capture_polling_enabled?).and_return(false))
allow(IdentityConfig.store).
to(receive(:doc_auth_link_sent_controller_enabled).and_return(true))

user
complete_doc_auth_steps_before_upload_step
Expand Down
26 changes: 0 additions & 26 deletions spec/features/idv/doc_auth/link_sent_step_spec.rb

This file was deleted.

Loading