Skip to content

feat(auth): implement rate limiting for authentication endpoints#872

Open
Devsol-01 wants to merge 1 commit into
Junirezz:mainfrom
Devsol-01:main
Open

feat(auth): implement rate limiting for authentication endpoints#872
Devsol-01 wants to merge 1 commit into
Junirezz:mainfrom
Devsol-01:main

Conversation

@Devsol-01

Copy link
Copy Markdown
Contributor

feat(auth): implement rate limiting for authentication endpoints

Description

This PR introduces rate limiting for the authentication endpoints to improve security and protect against brute-force and denial-of-service attacks.

What's Changed

  • Added rate limiting to the login endpoint.
  • Added rate limiting to the signup endpoint.
  • Implemented exponential backoff after repeated failed attempts.
  • Integrated Redis for distributed rate limit storage.
  • Configured separate limits for login and signup requests.
  • Added middleware to handle rate limit responses consistently.

Why

Authentication endpoints are common targets for brute-force attacks. This implementation helps mitigate abuse while maintaining a good user experience for legitimate users.

Testing

  • Verified login rate limiting after the configured number of failed attempts.
  • Verified signup rate limiting.
  • Confirmed lockout duration is enforced correctly.
  • Tested successful requests after the lockout period expires.

Checklist

  • Code follows project standards
  • Tested locally
  • No breaking changes introduced
  • Documentation updated (if applicable)

closes #801
closes #802
closes #803
closes #804

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant