-
Notifications
You must be signed in to change notification settings - Fork 115
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-15059: Socure timeout page #11572
Open
solipet
wants to merge
14
commits into
main
Choose a base branch
from
dprice/lg-15059-socure-timeout-page
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7fdf2c5
LG-15059: Socure timeout page
solipet 3d14807
updates to copy for timeout page, specs
solipet a74e303
fix the timeout template, check for in_person_enabled?
solipet 9c6f440
gymnastics to enter the IPP flow
solipet 3353b0c
renamed warning spec to timeout spec
solipet 5be7ecf
remove comments
solipet 87e77ff
log an event on choosing In Person
solipet f58705a
spec for socure_errors_controller
solipet f208c69
Move the direct_to_in_person route to the DocumentCaptureController.
solipet eea66db
feature spec: time out takes you to the Try Again page
solipet ed6d3e4
remove outdated spec
solipet 27c4de1
reorg document_capture_controller_spec.rb to include `it`s before `co…
solipet 230704a
spec for document_capture_controller#direct_in_person
solipet f172448
LINTS!!
solipet File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
# frozen_string_literal: true | ||
|
||
module Idv | ||
module Socure | ||
class ErrorsController < ApplicationController | ||
include Idv::AvailabilityConcern | ||
include IdvStepConcern | ||
include StepIndicatorConcern | ||
include Idv::AbTestAnalyticsConcern | ||
|
||
before_action :confirm_step_allowed | ||
before_action :set_in_person_available | ||
|
||
def timeout | ||
@remaining_submit_attempts = rate_limiter.remaining_count | ||
track_event(type: :timeout) | ||
end | ||
|
||
def self.step_info | ||
Idv::StepInfo.new( | ||
key: :socure_errors, | ||
controller: self, | ||
action: :timeout, | ||
next_steps: [FlowPolicy::FINAL], | ||
preconditions: ->(idv_session:, user:) do | ||
idv_session.socure_docv_wait_polling_started_at.present? | ||
end, | ||
undo_step: ->(idv_session:, user:) {}, | ||
) | ||
end | ||
|
||
private | ||
|
||
def rate_limiter | ||
RateLimiter.new(user: idv_session.current_user, rate_limit_type: :idv_doc_auth) | ||
end | ||
|
||
def track_event(type:) | ||
attributes = { type: type }.merge(ab_test_analytics_buckets) | ||
if type == :timeout | ||
attributes[:remaining_submit_attempts] = @remaining_submit_attempts | ||
end | ||
|
||
analytics.idv_doc_auth_socure_error_visited(**attributes) | ||
end | ||
|
||
def set_in_person_available | ||
@idv_in_person_url = in_person_enabled? ? | ||
idv_in_person_direct_path(step: :socure_doc_auth) : nil | ||
end | ||
|
||
def in_person_enabled? | ||
IdentityConfig.store.in_person_doc_auth_button_enabled && | ||
Idv::InPersonConfig.enabled_for_issuer?(document_capture_session&.issuer) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
<%= render( | ||
'idv/shared/error', | ||
type: :warning, | ||
title: t('idv.errors.technical_difficulties'), | ||
heading: t('idv.errors.technical_difficulties'), | ||
current_step: :verify_id, | ||
) do %> | ||
<p> | ||
<%= t('idv.errors.try_again_later') %> | ||
</p> | ||
<p> | ||
<%= t('idv.failure.warning.attempts_html', count: @remaining_submit_attempts) %> | ||
</p> | ||
|
||
<div class="margin-y-5"> | ||
<%= render ButtonComponent.new( | ||
url: idv_socure_document_capture_path, | ||
big: true, | ||
wide: true, | ||
).with_content(t('idv.failure.button.warning')) %> | ||
</div> | ||
|
||
<% if @idv_in_person_url %> | ||
<hr> | ||
|
||
<h2><%= t('in_person_proofing.headings.cta') %></h2> | ||
|
||
<p> | ||
<%= t('in_person_proofing.body.cta.prompt_detail') %> | ||
</p> | ||
|
||
<div class="margin-y-5"> | ||
<%= render ButtonComponent.new( | ||
url: @idv_in_person_url, | ||
big: true, | ||
wide: true, | ||
outline: true, | ||
).with_content(t('in_person_proofing.body.cta.button')) %> | ||
</div> | ||
<% end %> | ||
<% end %> | ||
<%= render('idv/doc_auth/cancel', step: 'socure') %> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍🏿
do we also need this behavior for the hybrid socure flow? 🤔