Monday, 5 August 2019

Rate limiter for Node.js API by user auth token

Hello, ive been exploring rate limiting for my mobile app express node.js API. What ive found so far is this solution with express-rate-limit and rate-limit-redis:app.use('/account/reset-password', rateLimit({store: (new RedisStore({//configs here})),windowMs: 5 * 60000,max: 12,delayMS: 0}));its clean, its nice, it probably works straightfoward, BUT it is not want I want. I want to rate limit my API calls by auth token, not IP address. What would be the simplest way to do this? Im REALLY not trying to write my own solution from scratch this time (Unless thats the ONLY good option), before today I had not even heard of redis etc..​Thanks in advance guys, I hope theres a pretty straight foward answer for this.

Submitted August 05, 2019 at 07:51PM by livinglibary

No comments:

Post a Comment