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
8 changes: 4 additions & 4 deletions app/controllers/concerns/idv_step_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,16 @@ module IdvStepConcern
end

def flow_session
user_session['idv/doc_auth']
user_session['idv/doc_auth'] || {}
end

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

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

def confirm_document_capture_complete
Expand All @@ -28,7 +28,7 @@ def confirm_document_capture_complete
flow_path == 'standard'
redirect_to idv_document_capture_url
else
flow_session&.delete('Idv::Steps::DocumentCaptureStep')
flow_session.delete('Idv::Steps::DocumentCaptureStep')
redirect_to idv_doc_auth_url
end
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/document_capture_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def confirm_upload_step_complete
end

def confirm_document_capture_needed
pii = flow_session&.[]('pii_from_doc') # hash with indifferent access
pii = flow_session['pii_from_doc'] # hash with indifferent access
return if pii.blank? && !idv_session.verify_info_step_complete?

redirect_to idv_ssn_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 @@ -106,7 +106,7 @@ def confirm_verify_info_step_needed
end

def pii
@pii = flow_session[:pii_from_user] if flow_session
@pii = flow_session[:pii_from_user]
end

def delete_pii
Expand All @@ -126,7 +126,7 @@ def increment_step_counts

# override StepUtilitiesConcern
def flow_session
user_session['idv/in_person']
user_session.fetch('idv/in_person', {})
Copy link
Contributor

@soniaconnolly soniaconnolly Apr 7, 2023

Choose a reason for hiding this comment

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

Comparing to idv_step_concern.rb line 12, can this line be changed to match? (and then I went ahead and merged it, but the question stands.)

end

def analytics_arguments
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/idv/verify_info_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ def analytics_arguments

# copied from verify_step
def pii
@pii = flow_session[:pii_from_doc] if flow_session
@pii = flow_session[:pii_from_doc]
end

def delete_pii
Expand Down
3 changes: 2 additions & 1 deletion spec/controllers/idv/ssn_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
let(:user) { create(:user) }

before do
allow(subject).to receive(:flow_session).and_return(flow_session)
stub_sign_in(user)
subject.user_session['idv/doc_auth'] = flow_session
stub_analytics
stub_attempts_tracker
allow(@analytics).to receive(:track_event)
Expand Down Expand Up @@ -78,6 +78,7 @@

context 'without a flow session' do
let(:flow_session) { nil }

it 'redirects to doc_auth' do
get :show

Expand Down