429 Errors when members attempt to login to website

Silverstripe Version:
4.x

Question:

We have an issue with our clients logging into their websites. They are getting 429 errors and being returned to a page which says

Too many requests

We have tried inserting the code which is supposed to prevent this from happening but it has no effect at all:

SilverStripe\Control\Director:
_ rules:_
_ ‘Security//$Action/$ID/$OtherID’: SilverStripe\Security\Security_

We are using a customised login page which contains javascript and CSS but we need this in order to ensure the page has the correct look and feel for the site.

We get this issue no matter which version of SS 4 we try running.

Is there a solution to this issue?

429----- Too Many Requests. The user has sent too many requests in a given amount of time (“rate limiting”). … Likewise, it might identify the user by its authentication credentials, or a stateful cookie. Responses with the 429 status code MUST NOT be stored by a cache.

Feels like the problem exists in your JS. If the form is submitted by the JS, then you may want to check if it’s submitting the credentials infinitely.

Check if the member is being redirected to the login page when they are already logged in. A bit of stray code was causing this for me. The code was checking for a member’s permission to view a page and redirecting to the login page instead of a permission failure.