Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[5.7] Change ThrottlesLogins lockout response code to HTTP 429 #23959

Closed
wants to merge 1 commit into from
Closed

[5.7] Change ThrottlesLogins lockout response code to HTTP 429 #23959

wants to merge 1 commit into from

Conversation

jakebathman
Copy link
Contributor

Currently, a user that attempts too many incorrect logins receives a response with an HTTP status code 423 with the message Too many login attempts. Please try again in :seconds seconds.

HTTP 423 is the wrong code for this; it's meant for WebDAV to indicate that a resource (file) is locked, as described in RFC 4918, not that a user account is locked.

The appropriate code is 429 which matches the current return code in ThrottleRequestsException thrown by the generic ThrottleRequests middleware.

This will be a breaking change, and is therefore targeted to the 5.7 release.

Let me know if anyone has questions or comments. Thanks!

@tillkruss
Copy link
Contributor

Surprising nobody noticed that until now.

@laurencei
Copy link
Contributor

laurencei commented Apr 21, 2018

So given we now have ThrottleRequestsException - is thowing a ValidationException even the right response in the first place?

There is no validation error - so why throw a validation response?

We can DRY this up and just throw a ThrottleRequestsException here cant we?

@taylorotwell
Copy link
Member

Fixed on 5.6 as really a bug.

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.

4 participants