my aim is 10 tires before lockout for 10 minutes. and if the user tries again and has 5 more failed attempts the lock time increase to 20 minutes. after 20 minutes, if the same user has 3 failed attempts lockout is 1 hour and finally, After 1 hour if the same user gets it wrong again, it locks them out for 24 hours.
how could I do that? I am using express-rate-limit and passing it as middleware
const rateLimit = require('express-rate-limit');
const apiLimiter = rateLimit({
windowMs: 10 * 60 * 1000,
headers: true,
max: 10,
});
module.exports = apiLimiter;
the first attempt working but to do the next attempt.