Skip to content

Commit

Permalink
Lg 15159 A user who has reached the capture complete page in hybrid f…
Browse files Browse the repository at this point in the history
…low should not be able to recapture (#11782)

* Bug Fixes, socure, user who reached capture complete page should not be able to recapture

* changelog: Bug Fixes, socure, user who reached capture complete page should not be able to recapture

* Addressing pr comments for improved code styling
  • Loading branch information
AShukla-GSA authored Jan 23, 2025
1 parent b1be266 commit 3987266
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ class DocumentCaptureController < ApplicationController
include SocureErrorsConcern

check_or_render_not_found -> { IdentityConfig.store.socure_docv_enabled }
before_action :validate_step_not_completed, only: [:show]
before_action :check_valid_document_capture_session, except: [:update]
before_action -> do
redirect_to_correct_vendor(Idp::Constants::Vendors::SOCURE, in_hybrid_mobile: true)
Expand Down Expand Up @@ -84,6 +85,11 @@ def errors

private

def validate_step_not_completed
return if stored_result.blank? || !stored_result.success?
redirect_to idv_hybrid_mobile_capture_complete_url
end

def socure_errors_presenter(result)
SocureErrorPresenter.new(
error_code: error_code_for(result),
Expand Down
7 changes: 4 additions & 3 deletions spec/features/idv/hybrid_mobile/hybrid_socure_mobile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,11 @@
expect(page).to have_text(t('doc_auth.instructions.switch_back'))
expect_step_indicator_current_step(t('step_indicator.flows.idv.verify_id'))

# To be fixed in app:
# Confirm app disallows jumping back to DocumentCapture page
# visit idv_hybrid_mobile_socure_document_capture_url
# expect(page).to have_current_path(idv_hybrid_mobile_capture_complete_url)
visit idv_hybrid_mobile_socure_document_capture_url
expect(page).to have_current_path(idv_hybrid_mobile_capture_complete_url)
visit idv_hybrid_mobile_socure_document_capture_update_url
expect(page).to have_current_path(idv_hybrid_mobile_capture_complete_url)
end

perform_in_browser(:desktop) do
Expand Down

0 comments on commit 3987266

Please sign in to comment.