Skip to content

feat(auth): Add comprehensive 2FA logging to login flow#107378

Closed
sentry[bot] wants to merge 1 commit intomasterfrom
seer/feat-auth-2fa-logging
Closed

feat(auth): Add comprehensive 2FA logging to login flow#107378
sentry[bot] wants to merge 1 commit intomasterfrom
seer/feat-auth-2fa-logging

Conversation

@sentry
Copy link
Copy Markdown
Contributor

@sentry sentry Bot commented Jan 30, 2026

This PR addresses a gap in our login funnel visibility by introducing new log messages specifically for the Two-Factor Authentication (2FA) process. Previously, it was difficult to track user journeys and identify drop-offs or failures during the 2FA step.

New log messages have been added at critical points in the 2FA flow:

  • user.auth.2fa-required: Logged when a user is identified as needing 2FA but has not yet completed it. This occurs in src/sentry/utils/auth.py.
  • user.auth.2fa-passed: Logged when a user successfully passes 2FA validation, marking their session as 2FA-compliant. This occurs in src/sentry/utils/auth.py.
  • user.auth.2fa-success: Logged upon the complete and successful sign-in of a user after passing 2FA. This occurs in src/sentry/web/frontend/twofactor.py.
  • user.auth.2fa-failed: Logged when a user submits an invalid 2FA code. This occurs in src/sentry/web/frontend/twofactor.py.
  • user.auth.2fa-rate-limited: Logged when a user exceeds the allowed number of 2FA attempts. This occurs in src/sentry/web/frontend/twofactor.py.

These new logs will provide much-needed insight into the 2FA stage of the login process, allowing for better analysis of user experience, identification of friction points, and improved debugging capabilities for 2FA-related issues.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

@github-actions github-actions Bot added the Scope: Backend Automatically applied to PRs that change backend components label Jan 30, 2026
@getsantry
Copy link
Copy Markdown
Contributor

getsantry Bot commented Feb 21, 2026

This pull request has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you add the label WIP, I will leave it alone unless WIP is removed ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀

@getsantry getsantry Bot added the Stale label Feb 21, 2026
@getsantry getsantry Bot closed this Mar 1, 2026
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 16, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Scope: Backend Automatically applied to PRs that change backend components Stale

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants