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
2 changes: 1 addition & 1 deletion app/controllers/concerns/idv_session.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ module IdvSession
end

def confirm_idv_session_started
redirect_to idv_doc_auth_url if idv_session.applicant.blank?
redirect_to idv_verify_info_url if idv_session.applicant.blank?
end

def confirm_idv_needed
Expand Down
2 changes: 2 additions & 0 deletions app/controllers/frontend_log_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ class FrontendLogController < ApplicationController
'Multi-Factor Authentication: download backup code' => :multi_factor_auth_backup_code_download,
'Show Password button clicked' => :show_password_button_clicked,
'IdV: personal key acknowledgment toggled' => :idv_personal_key_acknowledgment_toggled,
'IdV: user clicked sp link on ready to verify page' => :idv_in_person_ready_to_verify_sp_link_clicked,
'IdV: user clicked what to bring link on ready to verify page' => :idv_in_person_ready_to_verify_what_to_bring_link_clicked,
}.transform_values { |method| AnalyticsEvents.instance_method(method) }.freeze
# rubocop:enable Layout/LineLength

Expand Down
6 changes: 1 addition & 5 deletions app/controllers/idv/address_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ def success
profile_params.each do |key, value|
user_session['idv/doc_auth']['pii_from_doc'][key] = value
end
if IdentityConfig.store.doc_auth_verify_info_controller_enabled
redirect_to idv_verify_info_url
else
redirect_to idv_doc_auth_url
end
redirect_to idv_verify_info_url
end

def failure
Expand Down
65 changes: 34 additions & 31 deletions app/controllers/idv/in_person/usps_locations_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,42 +12,27 @@ class UspsLocationsController < ApplicationController

before_action :confirm_authenticated_for_api, only: [:update]

rescue_from Faraday::TimeoutError,
Faraday::BadRequestError,
Faraday::ForbiddenError,
StandardError,
with: :handle_error

# retrieve the list of nearby IPP Post Office locations with a POST request
def index
response = []
begin
if IdentityConfig.store.arcgis_search_enabled
candidate = UspsInPersonProofing::Applicant.new(
address: search_params['street_address'],
city: search_params['city'], state: search_params['state'],
zip_code: search_params['zip_code']
)
response = proofer.request_facilities(candidate)
else
response = proofer.request_pilot_facilities
end
render json: response.to_json
rescue Faraday::TimeoutError, Faraday::BadRequestError, Faraday::ForbiddenError => err
analytics.idv_in_person_locations_request_failure(
api_status_code: 422,
exception_class: err.class,
exception_message: err.message,
response_body_present: err.respond_to?(:response_body) && err.response_body.present?,
response_body: err.respond_to?(:response_body) && err.response_body,
response_status_code: err.respond_to?(:response_status) && err.response_status,
)
render json: {}, status: :unprocessable_entity
rescue => err
analytics.idv_in_person_locations_request_failure(
api_status_code: 500,
exception_class: err.class,
exception_message: err.message,
response_body_present: err.respond_to?(:response_body) && err.response_body.present?,
response_body: err.respond_to?(:response_body) && err.response_body,
response_status_code: err.respond_to?(:response_status) && err.response_status,
if IdentityConfig.store.arcgis_search_enabled
candidate = UspsInPersonProofing::Applicant.new(
address: search_params['street_address'],
city: search_params['city'], state: search_params['state'],
zip_code: search_params['zip_code']
)
render json: {}, status: :internal_server_error
response = proofer.request_facilities(candidate)
else
response = proofer.request_pilot_facilities
end

render json: response.to_json
end

def proofer
Expand All @@ -66,6 +51,24 @@ def update

protected

def handle_error(err)
remapped_error = {
Faraday::TimeoutError => :unprocessable_entity,
Faraday::BadRequestError => :unprocessable_entity,
Faraday::ForbiddenError => :unprocessable_entity,
}[err.class] || :internal_server_error

analytics.idv_in_person_locations_request_failure(
api_status_code: Rack::Utils.status_code(remapped_error),
exception_class: err.class,
exception_message: err.message,
response_body_present: err.respond_to?(:response_body) && err.response_body.present?,
response_body: err.respond_to?(:response_body) && err.response_body,
response_status_code: err.respond_to?(:response_status) && err.response_status,
)
render json: {}, status: remapped_error
end

def confirm_authenticated_for_api
render json: { success: false }, status: :unauthorized if !effective_user
end
Expand Down
13 changes: 2 additions & 11 deletions app/controllers/idv/review_controller.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
module Idv
class ReviewController < ApplicationController
before_action :personal_key_confirmed
before_action :confirm_verify_info_complete

include IdvStepConcern
include StepIndicatorConcern
Expand All @@ -15,7 +14,7 @@ class ReviewController < ApplicationController
with: :handle_request_enroll_exception

def confirm_idv_steps_complete
return redirect_to(idv_doc_auth_url) unless idv_profile_complete?
return redirect_to(idv_verify_info_url) unless idv_profile_complete?
return redirect_to(idv_phone_url) unless idv_address_complete?
end

Expand Down Expand Up @@ -92,7 +91,7 @@ def flash_message_content
end

def idv_profile_complete?
idv_session.profile_confirmation == true
!!idv_session.profile_confirmation
end

def idv_address_complete?
Expand Down Expand Up @@ -125,14 +124,6 @@ def password
params.fetch(:user, {})[:password].presence
end

def confirm_verify_info_complete
return unless IdentityConfig.store.doc_auth_verify_info_controller_enabled
return unless user_fully_authenticated?
return if idv_session.resolution_successful

redirect_to idv_verify_info_url
end

def personal_key_confirmed
return unless current_user
return unless current_user.active_profile.present? && need_personal_key_confirmation?
Expand Down
10 changes: 1 addition & 9 deletions app/controllers/idv/session_errors_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,15 +59,7 @@ def set_try_again_path
if in_person_flow?
@try_again_path = idv_in_person_path
else
@try_again_path = doc_auth_try_again_path
end
end

def doc_auth_try_again_path
if IdentityConfig.store.doc_auth_verify_info_controller_enabled
idv_verify_info_url
else
idv_doc_auth_path
@try_again_path = idv_verify_info_url
end
end

Expand Down
4 changes: 1 addition & 3 deletions app/controllers/reactivate_account_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@ class ReactivateAccountController < ApplicationController
before_action :confirm_two_factor_authenticated
before_action :confirm_password_reset_profile

def index
@personal_key_generated_at = current_user.personal_key_generated_at
end
def index; end

def update
reactivate_account_session.suspend
Expand Down
4 changes: 0 additions & 4 deletions app/models/user.rb
Original file line number Diff line number Diff line change
Expand Up @@ -101,10 +101,6 @@ def pending_profile
profiles.gpo_verification_pending.order(created_at: :desc).first
end

def personal_key_generated_at
encrypted_recovery_code_digest_generated_at || active_profile&.verified_at
end

def default_phone_configuration
phone_configurations.order('made_default_at DESC NULLS LAST, created_at').first
end
Expand Down
3 changes: 2 additions & 1 deletion app/presenters/account_show_presenter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ def backup_codes_generated_at
end

def personal_key_generated_at
decorated_user.user.personal_key_generated_at
decorated_user.user.encrypted_recovery_code_digest_generated_at ||
decorated_user.user.active_profile&.verified_at
end

def header_personalization
Expand Down
24 changes: 24 additions & 0 deletions app/services/analytics_events.rb
Original file line number Diff line number Diff line change
Expand Up @@ -707,6 +707,24 @@ def idv_in_person_ready_to_verify_visit(proofing_components: nil, **extra)
)
end

# The user clicked the sp link on the "ready to verify" page
def idv_in_person_ready_to_verify_sp_link_clicked(**extra)
track_event(
'IdV: user clicked sp link on ready to verify page',
**extra,
)
end

# The user clicked the what to bring link on the "ready to verify" page
def idv_in_person_ready_to_verify_what_to_bring_link_clicked(**extra)
track_event(
'IdV: user clicked what to bring link on ready to verify page',
**extra,
)
end

# User has consented to share information with document upload and may
# view the "hybrid handoff" step next unless "skip_upload" param is true
def idv_doc_auth_agreement_submitted(**extra)
track_event('IdV: doc auth agreement submitted', **extra)
end
Expand Down Expand Up @@ -908,10 +926,15 @@ def idv_doc_auth_submitted_pii_validation(
)
end

# The "hybrid handoff" step: Desktop user has submitted their choice to
# either continue via desktop ("document_capture" destination) or switch
# to mobile phone ("send_link" destination) to perform document upload.
# Mobile users sill log this event but with skip_upload_step = true
def idv_doc_auth_upload_submitted(**extra)
track_event('IdV: doc auth upload submitted', **extra)
end

# Desktop user has reached the above "hybrid handoff" view
def idv_doc_auth_upload_visited(**extra)
track_event('IdV: doc auth upload visited', **extra)
end
Expand All @@ -930,6 +953,7 @@ def idv_doc_auth_verify_visited(**extra)
track_event('IdV: doc auth verify visited', **extra)
end

# @identity.idp.previous_event_name IdV: doc auth optional verify_wait submitted
def idv_doc_auth_verify_proofing_results(**extra)
track_event('IdV: doc auth verify proofing results', **extra)
end
Expand Down
6 changes: 1 addition & 5 deletions app/services/idv/flows/doc_auth_flow.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ class DocAuthFlow < Flow::BaseFlow
email_sent: Idv::Steps::EmailSentStep,
document_capture: Idv::Steps::DocumentCaptureStep,
ssn: Idv::Steps::SsnStep,
verify: Idv::Steps::VerifyStep,
verify_wait: Idv::Steps::VerifyWaitStep,
}.freeze

STEP_INDICATOR_STEPS = [
Expand All @@ -31,9 +29,7 @@ class DocAuthFlow < Flow::BaseFlow
*([name: :secure_account] if IdentityConfig.store.gpo_personal_key_after_otp),
].freeze

OPTIONAL_SHOW_STEPS = {
verify_wait: Idv::Steps::VerifyWaitStepShow,
}.freeze
OPTIONAL_SHOW_STEPS = {}.freeze

ACTIONS = {
cancel_send_link: Idv::Actions::CancelSendLinkAction,
Expand Down
12 changes: 2 additions & 10 deletions app/services/idv/steps/ssn_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ def call
)

idv_session.delete('applicant')
# rubocop:disable Style/IfUnlessModifier
if IdentityConfig.store.doc_auth_verify_info_controller_enabled
exit_flow_state_machine
end
# rubocop:enable Style/IfUnlessModifier

flow_session[:flow_path] = @flow.flow_path
end

def extra_view_variables
Expand Down Expand Up @@ -59,11 +56,6 @@ def invalid_state?
def updating_ssn
flow_session.dig(:pii_from_doc, :ssn).present?
end

def exit_flow_state_machine
flow_session[:flow_path] = @flow.flow_path
redirect_to idv_verify_info_url
end
end
end
end
32 changes: 0 additions & 32 deletions app/services/idv/steps/verify_step.rb

This file was deleted.

13 changes: 0 additions & 13 deletions app/services/idv/steps/verify_wait_step.rb

This file was deleted.

27 changes: 0 additions & 27 deletions app/services/idv/steps/verify_wait_step_show.rb

This file was deleted.

21 changes: 0 additions & 21 deletions app/views/idv/doc_auth/verify.html.erb

This file was deleted.

Loading