Add event dispatch on successful Email TFA (expose TfaSucceedEvent)

Created on 11 November 2025, 3 months ago

Problem/Motivation

The email_tfa module does not currently expose an event when the email-based 2FA workflow completes successfully.
For external integrations (auditing, analytics, custom rate limiting, notifications, SSO flows, etc.), it is useful to have a Symfony event that other modules can subscribe to when Email TFA succeeds—without relying on hooks or overrides.

Steps to reproduce

  • Enable email_tfa and configure the standard email verification flow.
  • Perform a login that requires Email TFA and complete verification successfully.
  • There is no public event fired to indicate “TFA succeed” for other modules to subscribe to.

Proposed resolution

Expose a TfaSucceedEvent and dispatch it right after Email TFA is validated successfully and just before/around user_login_finalize($user).

Remaining tasks

  • Confirm the exact dispatch point (after successful Email TFA validation, before/around user_login_finalize() as appropriate).
  • Add kernel test(s) verifying:
    • email_tfa.succeed is dispatched when Email TFA completes successfully.
    • The event provides UserInterface and timestamp.
  • Update README/CHANGELOG to document the new event.
Feature request
Status

Active

Version

2.0

Component

Code

Created by

🇺🇾Uruguay jjose.quevedo

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

No activities found.

Production build 0.71.5 2024