backend: reduce login attempt window to 5 minutes and skip successful requests

This commit is contained in:
juancarmore 2025-07-22 12:39:03 +02:00
parent 894864d1e5
commit b92aec9d30

View File

@ -217,8 +217,9 @@ const getAuthenticatedUserOrAnonymous = async (req: Request): Promise<User> => {
// Limit login attempts to avoid brute force attacks
const loginLimiter = rateLimit({
windowMs: ms('15m'),
windowMs: ms('5m'),
limit: 5,
skipSuccessfulRequests: true,
message: 'Too many login attempts, please try again later'
});