Skip to content

feat: add TwoFactorAuthRequested and PasswordExpiryWarningRequested filters to login flow - #748

Merged
ZamanChaudhary merged 1 commit into
develop-ulmofrom
feat/EDLYPRODUCT-8313-2fa-password-expiry-login-filters
Aug 3, 2026
Merged

feat: add TwoFactorAuthRequested and PasswordExpiryWarningRequested filters to login flow#748
ZamanChaudhary merged 1 commit into
develop-ulmofrom
feat/EDLYPRODUCT-8313-2fa-password-expiry-login-filters

Conversation

@ZamanChaudhary

@ZamanChaudhary ZamanChaudhary commented Jun 23, 2026

Copy link
Copy Markdown

Ticket

EDLYPRODUCT-8313

Summary

  • Add a TwoFactorAuthRequested filter call in login_user to gate login completion behind an optional OTP/2FA challenge.
  • Add a PasswordExpiryWarningRequested filter call (non-blocking) to warn users when their password is nearing expiry, mirroring the existing HIBP nudge pattern.
  • Both filters are implemented in edly_features_app.filters and follow the existing openedx-filters extension pattern already used for RegistrationValidationRequested.

Changes

  • openedx/core/djangoapps/user_authn/views/login.py
    • Import PasswordExpiryWarningRequested and TwoFactorAuthRequested from edly_features_app.filters.
    • Run TwoFactorAuthRequested.run_filter(user=possibly_authenticated_user, request=request) before _handle_successful_authentication_and_login, gating session login behind 2FA when enabled.
    • Run PasswordExpiryWarningRequested.run_filter(user=possibly_authenticated_user, request=request, redirect_url=redirect_url) after successful login to surface an expiry warning without blocking the redirect.

@ZamanChaudhary
ZamanChaudhary merged commit cfddb0c into develop-ulmo Aug 3, 2026
17 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants