Skip to content

Add user_enable_two_factor email notifications and audit events

What does this MR do and why?

Adds email notifications and audit events when a user registers a OTP authenticator or WebAuthn device.

  • Creates the user_enable_two_factor audit event type

References

Screenshots or screen recordings

OTP WebAuthn
Screenshot_2025-09-15_at_6.55.19_PM Screenshot_2025-09-15_at_6.55.27_PM

Audit event entry: Screenshot_2025-09-15_at_6.57.49_PM

How to set up and validate locally

  1. Enable two-factor authentication for an account
  2. Review sent email in /rails/letter_opener/
  3. View Audit events for entry

For Enterprise Users:

  1. Simulate a SaaS instance
  2. Create a top-level group and assign it a Premium subscription
  3. Verify a domain
    domain = PagesDomain.last
    domain = update!(
      verified_at: Time.current,
      enabled_until: 1.year.from_now
    )
    ::Groups::EnterpriseUsers::BulkAssociateByDomainWorker.perform_async(domain.id)
  4. Re-do the above instructions

MR acceptance checklist

Evaluate this MR against the MR acceptance checklist. It helps you analyze changes to reduce risks in quality, performance, reliability, security, and maintainability.

Edited by Jio Castillo

Merge request reports

Loading