diff --git a/app/controllers/idv/hybrid_handoff_controller.rb b/app/controllers/idv/hybrid_handoff_controller.rb
index b04d02375a9..1d851f73af1 100644
--- a/app/controllers/idv/hybrid_handoff_controller.rb
+++ b/app/controllers/idv/hybrid_handoff_controller.rb
@@ -211,6 +211,8 @@ def confirm_agreement_step_complete
end
def confirm_hybrid_handoff_needed
+ setup_for_redo if params[:redo]
+
return if !flow_session[:flow_path]
if flow_session[:flow_path] == 'standard'
@@ -220,6 +222,15 @@ def confirm_hybrid_handoff_needed
end
end
+ def setup_for_redo
+ flow_session[:redo_document_capture] = true
+ if flow_session[:skip_upload_step]
+ flow_session[:flow_path] = 'standard'
+ else
+ flow_session[:flow_path] = nil
+ end
+ end
+
def formatted_destination_phone
raw_phone = params.require(:doc_auth).permit(:phone)
PhoneFormatter.format(raw_phone, country_code: 'US')
diff --git a/app/views/idv/in_person/verify_info/show.html.erb b/app/views/idv/in_person/verify_info/show.html.erb
index e62ea772f2f..b2c0c0f82ed 100644
--- a/app/views/idv/in_person/verify_info/show.html.erb
+++ b/app/views/idv/in_person/verify_info/show.html.erb
@@ -26,11 +26,10 @@ locals:
) do %>
<%= t(
'doc_auth.headings.capture_scan_warning_html',
- link: render(
- FormLinkComponent.new(
- href: idv_doc_auth_step_path(step: :redo_document_capture),
- method: :put,
- ).with_content(t('doc_auth.headings.capture_scan_warning_link')),
+ link: link_to(
+ t('doc_auth.headings.capture_scan_warning_link'),
+ idv_hybrid_handoff_url(redo: true),
+ 'aria-label': t('doc_auth.headings.capture_scan_warning_link'),
),
) %>
<% end %>
diff --git a/app/views/idv/link_sent/show.html.erb b/app/views/idv/link_sent/show.html.erb
index b4a18d20abc..6196ae1a740 100644
--- a/app/views/idv/link_sent/show.html.erb
+++ b/app/views/idv/link_sent/show.html.erb
@@ -57,4 +57,10 @@
<%= javascript_packs_tag_once 'doc-capture-polling' %>
<% end %>
-<%= render 'idv/shared/back', action: 'cancel_link_sent', class: 'link-sent-back-link', step_url: :idv_doc_auth_step_url %>
+
+ <%= link_to(
+ '‹ ' + t('forms.buttons.back'),
+ idv_hybrid_handoff_url(redo: true),
+ class: 'link-sent-back-link',
+ ) %>
+
diff --git a/app/views/idv/verify_info/show.html.erb b/app/views/idv/verify_info/show.html.erb
index a0a586f3c27..eab7ca997f5 100644
--- a/app/views/idv/verify_info/show.html.erb
+++ b/app/views/idv/verify_info/show.html.erb
@@ -26,11 +26,10 @@ locals:
) do %>
<%= t(
'doc_auth.headings.capture_scan_warning_html',
- link: render(
- FormLinkComponent.new(
- href: idv_doc_auth_step_path(step: :redo_document_capture),
- method: :put,
- ).with_content(t('doc_auth.headings.capture_scan_warning_link')),
+ link: link_to(
+ t('doc_auth.headings.capture_scan_warning_link'),
+ idv_hybrid_handoff_url(redo: true),
+ 'aria-label': t('doc_auth.headings.capture_scan_warning_link'),
),
) %>
<% end %>
diff --git a/spec/controllers/idv/hybrid_handoff_controller_spec.rb b/spec/controllers/idv/hybrid_handoff_controller_spec.rb
index eae8825963f..18278fae178 100644
--- a/spec/controllers/idv/hybrid_handoff_controller_spec.rb
+++ b/spec/controllers/idv/hybrid_handoff_controller_spec.rb
@@ -92,6 +92,33 @@
end
end
+ context 'redo document capture' do
+ it 'does not redirect in standard flow' do
+ subject.user_session['idv/doc_auth'][:flow_path] = 'standard'
+
+ get :show, params: { redo: true }
+
+ expect(response).to render_template :show
+ end
+
+ it 'does not redirect in hybrid flow' do
+ subject.user_session['idv/doc_auth'][:flow_path] = 'hybrid'
+
+ get :show, params: { redo: true }
+
+ expect(response).to render_template :show
+ end
+
+ it 'redirects to document_capture on a mobile device' do
+ subject.user_session['idv/doc_auth'][:flow_path] = 'standard'
+ subject.user_session['idv/doc_auth'][:skip_upload_step] = true
+
+ get :show, params: { redo: true }
+
+ expect(response).to redirect_to(idv_document_capture_url)
+ end
+ end
+
describe '#update' do
let(:analytics_name) { 'IdV: doc auth upload submitted' }
diff --git a/spec/features/idv/actions/cancel_link_sent_action_spec.rb b/spec/features/idv/actions/cancel_link_sent_action_spec.rb
index dbeae7f3cb6..c66f7b3c8d0 100644
--- a/spec/features/idv/actions/cancel_link_sent_action_spec.rb
+++ b/spec/features/idv/actions/cancel_link_sent_action_spec.rb
@@ -9,9 +9,9 @@
complete_doc_auth_steps_before_link_sent_step
end
- it 'returns to link sent step' do
+ it 'returns to hybrid_handoff step' do
click_doc_auth_back_link
- expect(page).to have_current_path(idv_hybrid_handoff_path)
+ expect(page).to have_current_path(idv_hybrid_handoff_path, ignore_query: true)
end
end