-
Notifications
You must be signed in to change notification settings - Fork 167
LG-9971 Add outage before_actions to post-FSM controllers #8517
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
Changes from 10 commits
0947140
8898123
8081a7d
461ea2f
ee50ac2
56cc025
bde8ebc
5443afc
919ae7e
97ccdea
8fe1296
2d381aa
c090f3b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| module Idv | ||
| module OutageConcern | ||
| extend ActiveSupport::Concern | ||
|
|
||
| def check_for_outage | ||
| return if flow_session[:skip_vendor_outage] | ||
|
|
||
| return redirect_for_gpo_only if FeatureManagement.idv_gpo_only? | ||
| end | ||
|
|
||
| def redirect_for_gpo_only | ||
| return redirect_to vendor_outage_url unless FeatureManagement.gpo_verification_enabled? | ||
|
|
||
| # During a phone outage, skip the hybrid handoff | ||
| # step and go straight to document upload | ||
| flow_session[:skip_upload_step] = true unless FeatureManagement.idv_allow_hybrid_flow? | ||
|
|
||
| redirect_to idv_mail_only_warning_url | ||
| end | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -8,6 +8,7 @@ class DocAuthController < ApplicationController | |
| include Flow::FlowStateMachine | ||
| include Idv::ThreatMetrixConcern | ||
| include FraudReviewConcern | ||
| include Idv::OutageConcern | ||
|
|
||
| before_action :redirect_if_flow_completed | ||
| before_action :handle_fraud | ||
|
|
@@ -56,24 +57,5 @@ def do_meta_refresh(meta_refresh_count) | |
| def flow_session | ||
| user_session['idv/doc_auth'] | ||
| end | ||
|
|
||
| def check_for_outage | ||
| return if flow_session[:skip_vendor_outage] | ||
|
|
||
| return redirect_for_gpo_only if FeatureManagement.idv_gpo_only? | ||
| end | ||
|
|
||
| def redirect_for_gpo_only | ||
| return redirect_to vendor_outage_url unless FeatureManagement.gpo_verification_enabled? | ||
|
|
||
| # During a phone outage, skip the hybrid handoff | ||
| # step and go straight to document upload | ||
| flow_session[:skip_upload_step] = true unless FeatureManagement.idv_allow_hybrid_flow? | ||
|
|
||
| session[:vendor_outage_redirect] = current_step | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yay!! love deleting unused session vars! |
||
| session[:vendor_outage_redirect_from_idv] = true | ||
|
|
||
| redirect_to idv_mail_only_warning_url | ||
| end | ||
| end | ||
| end | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -4,6 +4,7 @@ class DocumentCaptureController < ApplicationController | |
| include DocumentCaptureConcern | ||
| include IdvSession | ||
| include IdvStepConcern | ||
| include OutageConcern | ||
|
Comment on lines
6
to
+7
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We talked about including OutageConcern in IdvStepConcern and putting the before action there. Did something end up blocking that?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I attempted this suggestion; however, the feature tests kept failing ... perhaps this can be refactored in a future iteration. |
||
| include StepIndicatorConcern | ||
| include StepUtilitiesConcern | ||
| include RateLimitConcern | ||
|
|
@@ -12,6 +13,7 @@ class DocumentCaptureController < ApplicationController | |
| before_action :confirm_upload_step_complete | ||
| before_action :confirm_document_capture_needed | ||
| before_action :override_csp_to_allow_acuant | ||
| before_action :check_for_outage, only: :show | ||
|
|
||
| def show | ||
| analytics.idv_doc_auth_document_capture_visited(**analytics_arguments) | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,10 +6,12 @@ class VerifyInfoController < ApplicationController | |
| include StepUtilitiesConcern | ||
| include Steps::ThreatMetrixStepHelper | ||
| include VerifyInfoConcern | ||
| include OutageConcern | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. added as suggested by @tomas-nava 👍🏿 |
||
|
|
||
| before_action :renders_404_if_flag_not_set | ||
| before_action :confirm_ssn_step_complete | ||
| before_action :confirm_verify_info_step_needed | ||
| before_action :check_for_outage, only: :show | ||
|
|
||
| def show | ||
| @step_indicator_steps = step_indicator_steps | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -2,6 +2,7 @@ module Idv | |
| class PhoneController < ApplicationController | ||
| include IdvStepConcern | ||
| include StepIndicatorConcern | ||
| include OutageConcern | ||
| include PhoneOtpRateLimitable | ||
| include PhoneOtpSendable | ||
|
|
||
|
|
@@ -10,6 +11,9 @@ class PhoneController < ApplicationController | |
| before_action :confirm_verify_info_step_complete | ||
| before_action :confirm_step_needed | ||
| before_action :set_idv_form | ||
| # rubocop:disable Rails/LexicallyScopedActionFilter | ||
| before_action :check_for_outage, only: :show | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why did rubocop complain about this one and not the others? |
||
| # rubocop:enable Rails/LexicallyScopedActionFilter | ||
|
|
||
| def new | ||
| analytics.idv_phone_use_different(step: params[:step]) if params[:step] | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.