Skip to content
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
17 changes: 0 additions & 17 deletions app/controllers/concerns/idv/outage_concern.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/controllers/concerns/idv/verify_info_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ def async_state_done(current_async_state)
end

def next_step_url
return idv_gpo_url if FeatureManagement.idv_gpo_only?
return idv_gpo_url if FeatureManagement.idv_by_mail_only?
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mail_only is a much better name!

idv_phone_url
end

Expand Down
15 changes: 13 additions & 2 deletions app/controllers/concerns/idv_step_concern.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ module IdvStepConcern
include IdvSession
include RateLimitConcern
include FraudReviewConcern
include Idv::OutageConcern
include Idv::AbTestAnalyticsConcern

included do
Expand All @@ -14,7 +13,7 @@ module IdvStepConcern
before_action :confirm_no_pending_gpo_profile
before_action :confirm_no_pending_in_person_enrollment
before_action :handle_fraud
before_action :check_for_outage
before_action :check_for_mail_only_outage
end

def confirm_no_pending_gpo_profile
Expand All @@ -26,6 +25,18 @@ def confirm_no_pending_in_person_enrollment
redirect_to idv_in_person_ready_to_verify_url if current_user&.pending_in_person_enrollment
end

def check_for_mail_only_outage
return if idv_session.mail_only_warning_shown

return redirect_for_mail_only if FeatureManagement.idv_by_mail_only?
end

def redirect_for_mail_only
return redirect_to vendor_outage_url unless FeatureManagement.gpo_verification_enabled?

redirect_to idv_mail_only_warning_url
end

def pii_from_doc
flow_session['pii_from_doc']
end
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
module Idv
class GpoOnlyWarningController < ApplicationController
class MailOnlyWarningController < ApplicationController
include IdvSession
include StepIndicatorConcern

before_action :confirm_two_factor_authenticated

def show
analytics.idv_mail_only_warning_visited(analytics_id: 'Doc Auth')

flow_session[:skip_vendor_outage] = true
if defined?(idv_session)
idv_session.mail_only_warning_shown = true
end
render :show, locals: { current_sp:, exit_url: }
end

Expand Down
4 changes: 2 additions & 2 deletions app/presenters/idv/gpo_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ def resend_requested?
end

def back_or_cancel_partial
if FeatureManagement.idv_gpo_only?
if FeatureManagement.idv_by_mail_only?
'idv/doc_auth/cancel'
else
'idv/shared/back'
end
end

def back_or_cancel_parameters
if FeatureManagement.idv_gpo_only?
if FeatureManagement.idv_by_mail_only?
{ step: 'gpo' }
else
{ fallback_path: fallback_back_path }
Expand Down
1 change: 1 addition & 0 deletions app/services/idv/session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ class Session
had_barcode_read_failure
idv_consent_given
idv_phone_step_document_capture_session_uuid
mail_only_warning_shown
personal_key
phone_for_mobile_flow
pii
Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@
match '/*path' => 'unavailable#show', via: %i[get post]
end

get '/mail_only_warning' => 'gpo_only_warning#show'
get '/mail_only_warning' => 'mail_only_warning#show'
get '/come_back_later' => 'come_back_later#show'
get '/personal_key' => 'personal_key#show'
post '/personal_key' => 'personal_key#update'
Expand Down
2 changes: 1 addition & 1 deletion lib/feature_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ def self.idv_allow_hybrid_flow?
true
end

def self.idv_gpo_only?
def self.idv_by_mail_only?
outage_status = OutageStatus.new
IdentityConfig.store.feature_idv_force_gpo_verification_enabled ||
outage_status.any_phone_vendor_outage? ||
Expand Down
4 changes: 2 additions & 2 deletions spec/controllers/concerns/idv_step_concern_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ def show
)
end

it 'includes check_for_outage before_action' do
it 'includes check_for_mail_only_outage before_action' do
expect(Idv::StepController).to have_actions(
:before,
:check_for_outage,
:check_for_mail_only_outage,
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/agreement_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
it 'includes outage before_action' do
expect(subject).to have_actions(
:before,
:check_for_outage,
:check_for_mail_only_outage,
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/document_capture_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
it 'includes outage before_action' do
expect(subject).to have_actions(
:before,
:check_for_outage,
:check_for_mail_only_outage,
)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/getting_started_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
it 'includes outage before_action' do
expect(subject).to have_actions(
:before,
:check_for_outage,
:check_for_mail_only_outage,
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/hybrid_handoff_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
it 'includes outage before_action' do
expect(subject).to have_actions(
:before,
:check_for_outage,
:check_for_mail_only_outage,
)
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
it 'includes outage before_action' do
expect(subject).to have_actions(
:before,
:check_for_outage,
:check_for_mail_only_outage,
)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/link_sent_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
it 'includes outage before_action' do
expect(subject).to have_actions(
:before,
:check_for_outage,
:check_for_mail_only_outage,
)
end

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
require 'rails_helper'

RSpec.describe Idv::GpoOnlyWarningController do
RSpec.describe Idv::MailOnlyWarningController do
include IdvHelper

let(:user) { create(:user) }

before do
stub_sign_in(user)
stub_analytics
subject.user_session['idv/doc_auth'] = {}
end

describe 'before_actions' do
Expand Down Expand Up @@ -38,15 +37,10 @@
expect(@analytics).to have_logged_event(analytics_name, analytics_args)
end

context 'flow_session is nil' do
it 'renders the show template and initializes flow session' do
subject.user_session.delete('idv/doc_auth')

get :show
it 'sets idv_session.mail_only_warning_shown' do
get :show

expect(response).to render_template :show
expect(subject.user_session['idv/doc_auth'][:skip_vendor_outage]).to eq(true)
end
expect(subject.idv_session.mail_only_warning_shown).to eq(true)
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/phone_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
it 'includes outage before_action' do
expect(subject).to have_actions(
:before,
:check_for_outage,
:check_for_mail_only_outage,
)
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/ssn_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
it 'includes outage before_action' do
expect(subject).to have_actions(
:before,
:check_for_outage,
:check_for_mail_only_outage,
)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/verify_info_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
it 'includes outage before_action' do
expect(subject).to have_actions(
:before,
:check_for_outage,
:check_for_mail_only_outage,
)
end

Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/idv/welcome_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
it 'includes outage before_action' do
expect(subject).to have_actions(
:before,
:check_for_outage,
:check_for_mail_only_outage,
)
end

Expand Down