Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lg 15159 A user who has reached the capture complete page in hybrid flow should not be able to recapture #11782

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
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