Skip to content
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

Move condition check above potential database queries #11706

Merged
merged 2 commits into from
Jan 6, 2025
Merged
Changes from 1 commit
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 @@ -24,7 +24,10 @@ def create
increment_mfa_selection_attempt_count(otp_auth_method)
end
result = otp_verification_form.submit
post_analytics(result)

if UserSessionContext.confirmation_context?(context)
post_analytics(result)
mitchellhenke marked this conversation as resolved.
Show resolved Hide resolved
end

if UserSessionContext.authentication_or_reauthentication_context?(context)
handle_verification_for_authentication_context(
Expand Down Expand Up @@ -151,7 +154,7 @@ def form_params

def post_analytics(result)
properties = result.to_h.merge(analytics_properties)
analytics.multi_factor_auth_setup(**properties) if context == 'confirmation'
analytics.multi_factor_auth_setup(**properties)
end

def analytics_properties
Expand Down