Skip to content
Snippets Groups Projects
Unverified Commit e61b1c7b authored by edx-pipeline-bot's avatar edx-pipeline-bot Committed by GitHub
Browse files

Merge pull request #20832 from edx/private_to_public_319d54e

Mergeback PR from private to public.
parents e311dc2e 5747e978
No related merge requests found
......@@ -436,7 +436,7 @@ LOGIN_URL = reverse_lazy('login_redirect_to_lms')
# use the ratelimit backend to prevent brute force attacks
AUTHENTICATION_BACKENDS = [
'rules.permissions.ObjectPermissionBackend',
'ratelimitbackend.backends.RateLimitModelBackend',
'openedx.core.djangoapps.oauth_dispatch.dot_overrides.backends.EdxRateLimitedAllowAllUsersModelBackend',
]
LMS_BASE = None
......
......@@ -191,7 +191,7 @@ def _authenticate_first_party(request, unauthenticated_user):
raise AuthFailedError(_('Too many failed login attempts. Try again later.'))
def _handle_failed_authentication(user):
def _handle_failed_authentication(user, has_authentication):
"""
Handles updating the failed login count, inactive user notifications, and logging failed authentications.
"""
......@@ -199,7 +199,7 @@ def _handle_failed_authentication(user):
if LoginFailures.is_feature_enabled():
LoginFailures.increment_lockout_counter(user)
if not user.is_active:
if has_authentication and not user.is_active:
_log_and_raise_inactive_user_auth_error(user)
# if we didn't find this username earlier, the account for this email
......@@ -335,7 +335,7 @@ def login_user(request):
_enforce_password_policy_compliance(request, possibly_authenticated_user)
if possibly_authenticated_user is None or not possibly_authenticated_user.is_active:
_handle_failed_authentication(email_user)
_handle_failed_authentication(email_user, possibly_authenticated_user)
_handle_successful_authentication_and_login(possibly_authenticated_user, request)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment