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
9 changes: 0 additions & 9 deletions app/controllers/concerns/idv/step_utilities_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,6 @@ module Idv
module StepUtilitiesConcern
extend ActiveSupport::Concern

def flow_session
user_session['idv/doc_auth']
end

# copied from doc_auth_controller
def flow_path
flow_session[:flow_path]
end

# Copied from capture_doc_flow.rb
# and from doc_auth_flow.rb
def acuant_sdk_ab_test_analytics_args
Expand Down
18 changes: 14 additions & 4 deletions app/controllers/concerns/idv_step_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,21 @@ 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?
def flow_session
user_session['idv/doc_auth']
end

def pii_from_doc
flow_session&.[]('pii_from_doc')
end

flow_path = flow_session&.[](:flow_path)
# copied from doc_auth_controller
def flow_path
flow_session&.[](:flow_path)
end

def confirm_document_capture_complete
return if pii_from_doc.present?

if IdentityConfig.store.doc_auth_document_capture_controller_enabled &&
flow_path == 'standard'
Expand Down
20 changes: 3 additions & 17 deletions app/controllers/idv/address_controller.rb
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module Idv
class AddressController < ApplicationController
include IdvSession
include IdvStepConcern

before_action :confirm_two_factor_authenticated
before_action :confirm_document_capture_complete

def new
analytics.idv_address_visit

@presenter = AddressPresenter.new(pii: @pii)
@presenter = AddressPresenter.new(pii: pii_from_doc)
end

def update
Expand All @@ -24,22 +24,8 @@ def update

private

def confirm_document_capture_complete
@pii = user_session.dig('idv/doc_auth', 'pii_from_doc')
return if @pii.present?

flow_path = user_session.dig('idv/doc_auth', :flow_path)

if IdentityConfig.store.doc_auth_document_capture_controller_enabled &&
flow_path == 'standard'
redirect_to idv_document_capture_url
else
redirect_to idv_doc_auth_url
end
end

def idv_form
Idv::AddressForm.new(@pii)
Idv::AddressForm.new(pii_from_doc)
end

def success
Expand Down
1 change: 1 addition & 0 deletions app/controllers/idv/document_capture_controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module Idv
class DocumentCaptureController < ApplicationController
include IdvSession
include IdvStepConcern
include StepIndicatorConcern
include StepUtilitiesConcern
include DocumentCaptureConcern
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/ssn_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def extra_view_variables
private

def next_url
if @pii[:state] == 'PR'
if pii_from_doc[:state] == 'PR'
idv_address_url
else
idv_verify_info_url
Expand Down