From 99245265ef68365a155ffe8d86fda6ae5c5bd14b Mon Sep 17 00:00:00 2001 From: Sonia Connolly Date: Tue, 13 Jun 2023 14:22:46 -0700 Subject: [PATCH 1/5] Give each verify_info_controller its own update method Keep shared code in VerifyInfoConcern#shared_update. [skip changelog] Co-authored-by: Gina Yamada --- app/controllers/concerns/idv/verify_info_concern.rb | 2 +- app/controllers/idv/in_person/verify_info_controller.rb | 4 ++++ app/controllers/idv/verify_info_controller.rb | 4 ++++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/app/controllers/concerns/idv/verify_info_concern.rb b/app/controllers/concerns/idv/verify_info_concern.rb index b1c8ce2f56b..ef3d0d7f7d4 100644 --- a/app/controllers/concerns/idv/verify_info_concern.rb +++ b/app/controllers/concerns/idv/verify_info_concern.rb @@ -2,7 +2,7 @@ module Idv module VerifyInfoConcern extend ActiveSupport::Concern - def update + def shared_update return if idv_session.verify_info_step_document_capture_session_uuid analytics.idv_doc_auth_verify_submitted(**analytics_arguments) Funnel::DocAuth::RegisterStep.new(current_user.id, sp_session[:issuer]). diff --git a/app/controllers/idv/in_person/verify_info_controller.rb b/app/controllers/idv/in_person/verify_info_controller.rb index 9891320011c..6dba0a9ed29 100644 --- a/app/controllers/idv/in_person/verify_info_controller.rb +++ b/app/controllers/idv/in_person/verify_info_controller.rb @@ -36,6 +36,10 @@ def show process_async_state(load_async_state) end + def update + shared_update + end + private # state_id_type is hard-coded here because it's required for proofing against diff --git a/app/controllers/idv/verify_info_controller.rb b/app/controllers/idv/verify_info_controller.rb index f88706d7c39..7c87a96a71c 100644 --- a/app/controllers/idv/verify_info_controller.rb +++ b/app/controllers/idv/verify_info_controller.rb @@ -34,6 +34,10 @@ def show process_async_state(load_async_state) end + def update + shared_update + end + private # state ID type isn't manually set for Idv::VerifyInfoController From 58644b1b914e7ca0ec8187695361907e0c7463e8 Mon Sep 17 00:00:00 2001 From: Sonia Connolly Date: Tue, 13 Jun 2023 14:33:54 -0700 Subject: [PATCH 2/5] Move final redirects into individual update methods --- app/controllers/concerns/idv/verify_info_concern.rb | 3 ++- app/controllers/idv/in_person/verify_info_controller.rb | 7 ++----- app/controllers/idv/verify_info_controller.rb | 7 ++----- 3 files changed, 6 insertions(+), 11 deletions(-) diff --git a/app/controllers/concerns/idv/verify_info_concern.rb b/app/controllers/concerns/idv/verify_info_concern.rb index ef3d0d7f7d4..2f74a4754da 100644 --- a/app/controllers/concerns/idv/verify_info_concern.rb +++ b/app/controllers/concerns/idv/verify_info_concern.rb @@ -56,7 +56,8 @@ def shared_update # Mark the FSM verify step completed. This is for the 50/50 state flow_session['Idv::Steps::InPerson::VerifyStep'] = true - redirect_to after_update_url + + return true end private diff --git a/app/controllers/idv/in_person/verify_info_controller.rb b/app/controllers/idv/in_person/verify_info_controller.rb index 6dba0a9ed29..ee2387363cd 100644 --- a/app/controllers/idv/in_person/verify_info_controller.rb +++ b/app/controllers/idv/in_person/verify_info_controller.rb @@ -37,7 +37,8 @@ def show end def update - shared_update + success = shared_update + redirect_to idv_in_person_verify_info_url if success end private @@ -54,10 +55,6 @@ def invalid_state? pii.blank? end - def after_update_url - idv_in_person_verify_info_url - end - def prev_url idv_in_person_step_url(step: :ssn) end diff --git a/app/controllers/idv/verify_info_controller.rb b/app/controllers/idv/verify_info_controller.rb index 7c87a96a71c..d5d5b8e34de 100644 --- a/app/controllers/idv/verify_info_controller.rb +++ b/app/controllers/idv/verify_info_controller.rb @@ -35,7 +35,8 @@ def show end def update - shared_update + success = shared_update + redirect_to idv_verify_info_url if success end private @@ -43,10 +44,6 @@ def update # state ID type isn't manually set for Idv::VerifyInfoController def set_state_id_type; end - def after_update_url - idv_verify_info_url - end - def prev_url idv_ssn_url end From 39d8e323d65b128fd11274a9dc4a82219073a37c Mon Sep 17 00:00:00 2001 From: Sonia Connolly Date: Tue, 13 Jun 2023 14:42:40 -0700 Subject: [PATCH 3/5] Only mark InPerson::VerifyStep complete in InPerson::VerifyInfoController --- app/controllers/concerns/idv/verify_info_concern.rb | 3 --- app/controllers/idv/in_person/verify_info_controller.rb | 8 +++++++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/app/controllers/concerns/idv/verify_info_concern.rb b/app/controllers/concerns/idv/verify_info_concern.rb index 2f74a4754da..51eb7b74893 100644 --- a/app/controllers/concerns/idv/verify_info_concern.rb +++ b/app/controllers/concerns/idv/verify_info_concern.rb @@ -54,9 +54,6 @@ def shared_update flow_session[:flow_path] ||= 'standard' end - # Mark the FSM verify step completed. This is for the 50/50 state - flow_session['Idv::Steps::InPerson::VerifyStep'] = true - return true end diff --git a/app/controllers/idv/in_person/verify_info_controller.rb b/app/controllers/idv/in_person/verify_info_controller.rb index ee2387363cd..98c07f42826 100644 --- a/app/controllers/idv/in_person/verify_info_controller.rb +++ b/app/controllers/idv/in_person/verify_info_controller.rb @@ -38,7 +38,13 @@ def show def update success = shared_update - redirect_to idv_in_person_verify_info_url if success + + if success + # Mark the FSM verify step completed. This is for the 50/50 state + flow_session['Idv::Steps::InPerson::VerifyStep'] = true + + redirect_to idv_in_person_verify_info_url + end end private From b21c1ca14cdec16ac09609bfae2ae2b165cdae02 Mon Sep 17 00:00:00 2001 From: Sonia Connolly Date: Tue, 13 Jun 2023 14:49:40 -0700 Subject: [PATCH 4/5] Move redo_document_capture check to doc_auth VerifyInfoController The in_person flow does not use redo_document_capture --- app/controllers/concerns/idv/verify_info_concern.rb | 6 ------ app/controllers/idv/verify_info_controller.rb | 11 ++++++++++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/app/controllers/concerns/idv/verify_info_concern.rb b/app/controllers/concerns/idv/verify_info_concern.rb index 51eb7b74893..fcfddf75b72 100644 --- a/app/controllers/concerns/idv/verify_info_concern.rb +++ b/app/controllers/concerns/idv/verify_info_concern.rb @@ -48,12 +48,6 @@ def shared_update double_address_verification: capture_secondary_id_enabled, ) - # Don't allow the user to go back to document capture after verifying - if flow_session['redo_document_capture'] - flow_session.delete('redo_document_capture') - flow_session[:flow_path] ||= 'standard' - end - return true end diff --git a/app/controllers/idv/verify_info_controller.rb b/app/controllers/idv/verify_info_controller.rb index d5d5b8e34de..ac3afbbe809 100644 --- a/app/controllers/idv/verify_info_controller.rb +++ b/app/controllers/idv/verify_info_controller.rb @@ -36,7 +36,16 @@ def show def update success = shared_update - redirect_to idv_verify_info_url if success + + if success + # Don't allow the user to go back to document capture after verifying + if flow_session['redo_document_capture'] + flow_session.delete('redo_document_capture') + flow_session[:flow_path] ||= 'standard' + end + + redirect_to idv_verify_info_url + end end private From 31f674e8af9091d6fca3d02c6d94d04cb97fc17c Mon Sep 17 00:00:00 2001 From: Sonia Connolly Date: Wed, 14 Jun 2023 09:59:08 -0700 Subject: [PATCH 5/5] Remove empty verify_info/new template accidentally added back in Jan. --- app/views/idv/verify_info/new.html.erb | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 app/views/idv/verify_info/new.html.erb diff --git a/app/views/idv/verify_info/new.html.erb b/app/views/idv/verify_info/new.html.erb deleted file mode 100644 index e69de29bb2d..00000000000