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
13 changes: 0 additions & 13 deletions app/controllers/concerns/idv/step_utilities_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,6 @@ def flow_path
flow_session[:flow_path]
end

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.verify_info_step_complete?
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
13 changes: 13 additions & 0 deletions app/controllers/concerns/idv_step_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ module IdvStepConcern
before_action :confirm_idv_needed
end

def confirm_document_capture_complete
@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_verify_info_step_complete
return if idv_session.verify_info_step_complete?

Expand All @@ -18,6 +26,11 @@ def confirm_verify_info_step_complete
end
end

def confirm_verify_info_step_needed
return unless idv_session.verify_info_step_complete?
redirect_to idv_review_url
end

def confirm_address_step_complete
return if idv_session.address_step_complete?

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/idv/address_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ class AddressController < ApplicationController
include IdvSession

before_action :confirm_two_factor_authenticated
before_action :confirm_pii_from_doc
before_action :confirm_document_capture_complete

def new
analytics.idv_address_visit
Expand All @@ -24,7 +24,7 @@ def update

private

def confirm_pii_from_doc
def confirm_document_capture_complete
@pii = user_session.dig('idv/doc_auth', 'pii_from_doc')
return if @pii.present?
redirect_to idv_doc_auth_url
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/idv/in_person/verify_info_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class VerifyInfoController < ApplicationController
before_action :renders_404_if_flag_not_set
before_action :confirm_two_factor_authenticated
before_action :confirm_ssn_step_complete
before_action :confirm_profile_not_already_confirmed
before_action :confirm_verify_info_step_needed

def show
@in_person_proofing = true
Expand Down Expand Up @@ -107,7 +107,7 @@ def confirm_ssn_step_complete
redirect_to idv_in_person_url
end

def confirm_profile_not_already_confirmed
def confirm_verify_info_step_needed
# todo: should this instead be like so?
# return unless idv_session.resolution_successful == true
return unless idv_session.verify_info_step_complete?
Expand Down
6 changes: 3 additions & 3 deletions app/controllers/idv/ssn_controller.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
module Idv
class SsnController < ApplicationController
include IdvSession
include IdvStepConcern
include StepIndicatorConcern
include StepUtilitiesConcern
include Steps::ThreatMetrixStepHelper

before_action :confirm_two_factor_authenticated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that this method is defined in IdvSession, but auto-included as a before action in IdvStepConcern (which in turn includes IdvSession), should IdvSession be responsible for auto-including this before action?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is worth looking into as a separate cleanup. IdvSession is included in something like 20 controllers, so changing its included actions will take some research and care.

before_action :confirm_profile_not_already_confirmed
before_action :confirm_pii_from_doc
before_action :confirm_verify_info_step_needed
before_action :confirm_document_capture_complete

attr_accessor :error_message

Expand Down
3 changes: 1 addition & 2 deletions app/controllers/idv/verify_info_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ class VerifyInfoController < ApplicationController
include VerifyInfoConcern
include Steps::ThreatMetrixStepHelper

before_action :confirm_two_factor_authenticated
before_action :confirm_ssn_step_complete
before_action :confirm_profile_not_already_confirmed
before_action :confirm_verify_info_step_needed

def show
@in_person_proofing = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
it 'confirms verify step not already complete' do
expect(subject).to have_actions(
:before,
:confirm_profile_not_already_confirmed,
:confirm_verify_info_step_needed,
)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/ssn_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
it 'checks that the previous step is complete' do
expect(subject).to have_actions(
:before,
:confirm_pii_from_doc,
:confirm_document_capture_complete,
)
end
end
Expand Down