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
Original file line number Diff line number Diff line change
Expand Up @@ -170,18 +170,10 @@ def update_invalid_user

def handle_valid_verification_for_confirmation_context
user_session[:authn_at] = Time.zone.now
track_mfa_method_added
@next_mfa_setup_path = next_setup_path
reset_second_factor_attempts_count
end

def track_mfa_method_added
mfa_user = MfaContext.new(current_user)
mfa_count = mfa_user.enabled_mfa_methods_count
analytics.multi_factor_auth_added_phone(enabled_mfa_methods_count: mfa_count)
Funnel::Registration::AddMfa.call(current_user.id, 'phone', analytics)
end

def handle_valid_otp_for_authentication_context(auth_method:)
user_session[:auth_method] = auth_method
mark_user_session_authenticated(:valid_2fa)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ def create

def handle_valid_confirmation_otp
assign_phone
track_mfa_added
flash[:success] = t('notices.phone_confirmed')
end

Expand All @@ -46,6 +47,13 @@ def redirect_if_blank_phone
redirect_to new_user_session_path
end

def track_mfa_added
analytics.multi_factor_auth_added_phone(
enabled_mfa_methods_count: MfaContext.new(current_user).enabled_mfa_methods_count,
)
Funnel::Registration::AddMfa.call(current_user.id, 'phone', analytics)
end

def confirm_multiple_factors_enabled
return if UserSessionContext.confirmation_context?(context)
phone_enabled = phone_enabled?
Expand Down