Skip to content

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

Open
ZamanChaudhary wants to merge 1 commit into
develop-ulmofrom
feat/EDLYPRODUCT-8313-2fa-password-expiry-login-filters
Open

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

Conversation

@ZamanChaudhary

Copy link
Copy Markdown

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.

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