Class: Login::AfterLoginActions
- Inherits:
-
Object
- Object
- Login::AfterLoginActions
- Includes:
- Accountable
- Defined in:
- app/services/login/after_login_actions.rb
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#skip_mhv_account_creation ⇒ Object
readonly
Returns the value of attribute skip_mhv_account_creation.
Instance Method Summary collapse
- #check_id_mismatch(identity_value, mpi_value, error_message) ⇒ Object private
- #create_mhv_account ⇒ Object private
- #id_mismatch_validations ⇒ Object private
-
#initialize(user, skip_mhv_account_creation) ⇒ AfterLoginActions
constructor
A new instance of AfterLoginActions.
- #login_type ⇒ Object private
- #perform ⇒ Object
Methods included from Accountable
#account_login_stats, #log_error, #no_account_log_message, #update_account_login_stats, #verification_level
Methods included from SentryLogging
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata
Constructor Details
#initialize(user, skip_mhv_account_creation) ⇒ AfterLoginActions
Returns a new instance of AfterLoginActions.
11 12 13 14 |
# File 'app/services/login/after_login_actions.rb', line 11 def initialize(user, skip_mhv_account_creation) @current_user = user @skip_mhv_account_creation = skip_mhv_account_creation end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
9 10 11 |
# File 'app/services/login/after_login_actions.rb', line 9 def current_user @current_user end |
#skip_mhv_account_creation ⇒ Object (readonly)
Returns the value of attribute skip_mhv_account_creation.
9 10 11 |
# File 'app/services/login/after_login_actions.rb', line 9 def skip_mhv_account_creation @skip_mhv_account_creation end |
Instance Method Details
#check_id_mismatch(identity_value, mpi_value, error_message) ⇒ Object (private)
55 56 57 58 59 60 61 62 63 |
# File 'app/services/login/after_login_actions.rb', line 55 def check_id_mismatch(identity_value, mpi_value, ) return if mpi_value.blank? if identity_value != mpi_value error_data = { icn: current_user.icn } error_data.merge!(identity_value:, mpi_value:) unless .include?('SSN') Rails.logger.warn("[SessionsController version:v1] #{}", error_data) end end |
#create_mhv_account ⇒ Object (private)
34 35 36 37 38 |
# File 'app/services/login/after_login_actions.rb', line 34 def create_mhv_account return if skip_mhv_account_creation current_user.create_mhv_account_async end |
#id_mismatch_validations ⇒ Object (private)
44 45 46 47 48 49 50 51 52 53 |
# File 'app/services/login/after_login_actions.rb', line 44 def id_mismatch_validations return unless current_user.loa3? check_id_mismatch(current_user.identity.ssn, current_user.ssn_mpi, 'User Identity & MPI SSN values conflict') check_id_mismatch(current_user.identity.icn, current_user.mpi_icn, 'User Identity & MPI ICN values conflict') check_id_mismatch(current_user.identity.edipi, current_user.edipi_mpi, 'User Identity & MPI EDIPI values conflict') check_id_mismatch(current_user.identity.mhv_correlation_id, current_user.mpi_mhv_correlation_id, 'User Identity & MPI MHV Correlation ID values conflict') end |
#login_type ⇒ Object (private)
40 41 42 |
# File 'app/services/login/after_login_actions.rb', line 40 def login_type @login_type ||= current_user.identity.sign_in[:service_name] end |
#perform ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'app/services/login/after_login_actions.rb', line 16 def perform return unless current_user Login::UserCredentialEmailUpdater.new(credential_email: current_user.email, user_verification: current_user.user_verification).perform Login::UserAcceptableVerifiedCredentialUpdater.new(user_account: @current_user.user_account).perform update_account_login_stats(login_type) id_mismatch_validations create_mhv_account if Settings.test_user_dashboard.env == 'staging' TestUserDashboard::UpdateUser.new(current_user).call(Time.current) TestUserDashboard::AccountMetrics.new(current_user).checkout end end |