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: 6 additions & 0 deletions app/controllers/concerns/idv/step_utilities_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,16 @@ def flow_path
def confirm_pii_from_doc
@pii = flow_session&.[]('pii_from_doc') # hash with indifferent access
return if @pii.present?

flow_session&.delete('Idv::Steps::DocumentCaptureStep')
redirect_to idv_doc_auth_url
end

def confirm_profile_not_already_confirmed
return unless idv_session.profile_confirmation == true
redirect_to idv_review_url
end

# Copied from capture_doc_flow.rb
# and from doc_auth_flow.rb
def acuant_sdk_ab_test_analytics_args
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/doc_auth_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class DocAuthController < ApplicationController

FLOW_STATE_MACHINE_SETTINGS = {
step_url: :idv_doc_auth_step_url,
final_url: :idv_review_url,
final_url: :idv_ssn_url,
flow: Idv::Flows::DocAuthFlow,
analytics_id: 'Doc Auth',
}.freeze
Expand Down
1 change: 1 addition & 0 deletions app/controllers/idv/ssn_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ class SsnController < ApplicationController
include Steps::ThreatMetrixStepHelper

before_action :confirm_two_factor_authenticated
before_action :confirm_profile_not_already_confirmed
before_action :confirm_pii_from_doc

attr_accessor :error_message
Expand Down
11 changes: 1 addition & 10 deletions app/controllers/idv/verify_info_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -85,11 +85,7 @@ def update
private

def prev_url
if IdentityConfig.store.doc_auth_ssn_controller_enabled
idv_ssn_url
else
idv_doc_auth_url
end
idv_ssn_url
end

def analytics_arguments
Expand Down Expand Up @@ -118,11 +114,6 @@ def confirm_ssn_step_complete
redirect_to prev_url
end

def confirm_profile_not_already_confirmed
return unless idv_session.profile_confirmation == true
redirect_to idv_review_url
end

def current_flow_step_counts
user_session['idv/doc_auth_flow_step_counts'] ||= {}
user_session['idv/doc_auth_flow_step_counts'].default = 0
Expand Down
13 changes: 0 additions & 13 deletions app/services/idv/actions/cancel_update_ssn_action.rb

This file was deleted.

3 changes: 0 additions & 3 deletions app/services/idv/flows/doc_auth_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ class DocAuthFlow < Flow::BaseFlow
link_sent: Idv::Steps::LinkSentStep,
email_sent: Idv::Steps::EmailSentStep,
document_capture: Idv::Steps::DocumentCaptureStep,
ssn: Idv::Steps::SsnStep,
}.freeze

STEP_INDICATOR_STEPS = [
Expand All @@ -34,9 +33,7 @@ class DocAuthFlow < Flow::BaseFlow
ACTIONS = {
cancel_send_link: Idv::Actions::CancelSendLinkAction,
cancel_link_sent: Idv::Actions::CancelLinkSentAction,
cancel_update_ssn: Idv::Actions::CancelUpdateSsnAction,
redo_address: Idv::Actions::RedoAddressAction,
redo_ssn: Idv::Actions::RedoSsnAction,
redo_document_capture: Idv::Actions::RedoDocumentCaptureAction,
verify_document_status: Idv::Actions::VerifyDocumentStatusAction,
}.freeze
Expand Down
3 changes: 2 additions & 1 deletion app/services/idv/steps/doc_auth_base_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ def extract_pii_from_doc(response, store_in_session: false)

flow_session[:had_barcode_read_failure] = response.attention_with_barcode?
if store_in_session
flow_session[:pii_from_doc] = flow_session[:pii_from_doc].to_h.merge(pii_from_doc)
flow_session[:pii_from_doc] ||= {}
flow_session[:pii_from_doc].merge!(pii_from_doc)
idv_session.delete('applicant')
end
track_document_state(pii_from_doc[:state])
Expand Down
3 changes: 1 addition & 2 deletions app/services/idv/steps/document_capture_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def self.analytics_submitted_event
def call
handle_stored_result if !FeatureManagement.document_capture_async_uploads_enabled?

exit_flow_state_machine if IdentityConfig.store.doc_auth_ssn_controller_enabled
exit_flow_state_machine
end

def extra_view_variables
Expand All @@ -42,7 +42,6 @@ def extra_view_variables

def exit_flow_state_machine
flow_session[:flow_path] = @flow.flow_path
redirect_to idv_ssn_url if @flow.instance_of?(Idv::Flows::DocAuthFlow)
end

def native_camera_ab_testing_variables
Expand Down
7 changes: 1 addition & 6 deletions app/services/idv/steps/link_sent_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,11 @@ def extra_view_variables

private

def exit_flow_state_machine
flow_session[:flow_path] = @flow.flow_path
redirect_to idv_ssn_url
end

def handle_document_verification_success(get_results_response)
save_proofing_components
extract_pii_from_doc(get_results_response, store_in_session: true)
mark_steps_complete
exit_flow_state_machine if IdentityConfig.store.doc_auth_ssn_controller_enabled
flow_session[:flow_path] = @flow.flow_path
end

def render_document_capture_cancelled
Expand Down
61 changes: 0 additions & 61 deletions app/services/idv/steps/ssn_step.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/views/idv/ssn/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ locals:
<% end %>

<% if updating_ssn %>
<%= render 'idv/shared/back', action: 'cancel_update_ssn' %>
<%= render 'idv/shared/back', fallback_path: idv_verify_info_path %>
<% else %>
<%= render 'idv/doc_auth/cancel', step: 'ssn' %>
<% end %>
25 changes: 7 additions & 18 deletions app/views/idv/verify_info/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,13 @@ locals:
toggle_label: t('forms.ssn.show'),
) %>
</div>
<% if IdentityConfig.store.doc_auth_ssn_controller_enabled %>
<div class='grid-auto'>
<%= link_to(
t('idv.buttons.change_label'),
idv_ssn_url,
'aria-label': t('idv.buttons.change_ssn_label'),
) %>
</div>
<% else %>
<div class='grid-auto'>
<%= button_to(
idv_doc_auth_step_url(step: :redo_ssn),
method: :put,
class: 'usa-button usa-button--unstyled',
'aria-label': t('idv.buttons.change_ssn_label'),
) { t('idv.buttons.change_label') } %>
</div>
<% end %>
<div class='grid-auto'>
<%= link_to(
t('idv.buttons.change_label'),
idv_ssn_url,
'aria-label': t('idv.buttons.change_ssn_label'),
) %>
</div>
</div>
<div class="margin-top-5">
<%= render SpinnerButtonComponent.new(
Expand Down
1 change: 0 additions & 1 deletion config/application.yml.default
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ doc_auth_combined_hybrid_handoff_enabled: false
doc_auth_error_dpi_threshold: 290
doc_auth_error_sharpness_threshold: 40
doc_auth_error_glare_threshold: 40
doc_auth_ssn_controller_enabled: false
database_pool_extra_connections_for_worker: 4
database_pool_idp: 5
database_statement_timeout: 2_500
Expand Down
1 change: 0 additions & 1 deletion lib/identity_config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ def self.build_store(config_map)
config.add(:doc_auth_max_submission_attempts_before_native_camera, type: :integer)
config.add(:doc_auth_max_capture_attempts_before_tips, type: :integer)
config.add(:doc_auth_s3_request_timeout, type: :integer)
config.add(:doc_auth_ssn_controller_enabled, type: :boolean)
config.add(:doc_auth_vendor, type: :string)
config.add(:doc_auth_vendor_randomize, type: :boolean)
config.add(:doc_auth_vendor_randomize_percent, type: :integer)
Expand Down
23 changes: 11 additions & 12 deletions spec/controllers/idv/doc_auth_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@
it 'finishes the flow' do
get :show, params: { step: 'welcome' }

expect(response).to redirect_to idv_review_url
expect(response).to redirect_to idv_ssn_url
end
end
end
Expand All @@ -155,19 +155,18 @@
result = {
success: true,
errors: {},
step: 'ssn',
step: 'agreement',
flow_path: 'standard',
step_count: 1,
pii_like_keypaths: [[:errors, :ssn], [:error_details, :ssn]],
irs_reproofing: false,
analytics_id: 'Doc Auth',
acuant_sdk_upgrade_ab_test_bucket: :default,
}

put :update, params: { step: 'ssn', doc_auth: { step: 'ssn', ssn: '111-11-1111' } }
put :update, params: { step: 'agreement', doc_auth: { ial2_consent_given: '1' } }

expect(@analytics).to have_received(:track_event).with(
'IdV: doc auth ssn submitted', result
'IdV: doc auth agreement submitted', result
)
end

Expand All @@ -176,20 +175,20 @@
allow_any_instance_of(Flow::BaseFlow).to \
receive(:flow_session).and_return(pii_from_doc: {})

put :update, params: { step: 'ssn', doc_auth: { step: 'ssn', ssn: '666-66-6666' } }
put :update, params: { step: 'ssn', doc_auth: { step: 'ssn', ssn: '111-11-1111' } }
put :update, params: { step: 'agreement', doc_auth: { ial2_consent_given: '1' } }
put :update, params: { step: 'agreement', doc_auth: { ial2_consent_given: '1' } }

expect(@analytics).to have_received(:track_event).with(
'IdV: doc auth ssn submitted',
'IdV: doc auth agreement submitted',
hash_including(
step: 'ssn',
step: 'agreement',
step_count: 1,
acuant_sdk_upgrade_ab_test_bucket: :default,
),
)
expect(@analytics).to have_received(:track_event).with(
'IdV: doc auth ssn submitted',
hash_including(step: 'ssn', step_count: 2),
'IdV: doc auth agreement submitted',
hash_including(step: 'agreement', step_count: 2),
)
end

Expand Down Expand Up @@ -233,7 +232,7 @@
it 'finishes the flow' do
put :update, params: { step: 'ssn' }

expect(response).to redirect_to idv_review_url
expect(response).to redirect_to idv_ssn_url
end
end
end
Expand Down
23 changes: 8 additions & 15 deletions spec/controllers/idv/verify_info_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,14 @@
end
end

it 'redirects to ssn controller when ssn info is missing' do
flow_session[:pii_from_doc][:ssn] = nil

get :show

expect(response).to redirect_to(idv_ssn_url)
end

context 'when the user is ssn throttled' do
before do
Throttle.new(
Expand All @@ -110,21 +118,6 @@
).increment_to_throttled!
end

context 'when using new ssn controller' do
before do
allow(IdentityConfig.store).to receive(:doc_auth_ssn_controller_enabled).
and_return(true)
end

it 'redirects to ssn controller when ssn info is missing' do
flow_session[:pii_from_doc][:ssn] = nil

get :show

expect(response).to redirect_to(idv_ssn_url)
end
end

it 'redirects to ssn failure url' do
get :show

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@
DocAuth::Mock::DocAuthMockClient.reset!
attach_and_submit_images

expect(current_path).to eq(idv_ssn_path)
fill_out_ssn_form_with_ssn_that_fails_resolution
click_on t('forms.buttons.submit.update')
expect(current_path).to eq(idv_verify_info_path)
check t('forms.ssn.show')
expect(page).to have_content(DocAuthHelper::SSN_THAT_FAILS_RESOLUTION)
Expand Down Expand Up @@ -62,6 +65,9 @@
DocAuth::Mock::DocAuthMockClient.reset!
attach_and_submit_images

expect(current_path).to eq(idv_ssn_path)
fill_out_ssn_form_with_ssn_that_fails_resolution
click_on t('forms.buttons.submit.update')
expect(current_path).to eq(idv_verify_info_path)
check t('forms.ssn.show')
expect(page).to have_content(DocAuthHelper::SSN_THAT_FAILS_RESOLUTION)
Expand Down
2 changes: 1 addition & 1 deletion spec/features/idv/cancel_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
expect(fake_analytics).to have_logged_event(
'IdV: cancellation visited',
proofing_components: { document_check: 'mock', document_type: 'state_id' },
request_came_from: 'idv/doc_auth#show',
request_came_from: 'idv/ssn#show',
step: 'ssn',
)

Expand Down
Loading