Is there a way to effectively limit the rate of my nestjs api calls? So far, I have explored various packages, but they all seem to limit based on the user's IP address.
Do you happen to know of any package that can achieve rate limiting using the user's access token instead?
If not, could you confirm if my understanding is correct?
IF (DB contains a record where [dbAccessToken === reqAccessToken])
IF (currentDate <= record.timestamp + limitSeconds)
=> throw "Rate Limit Error"
...
=> Resolve Request
=> Add record to DB
I believe my proposed solution could be effective, but I am concerned about the potential impact on the speed of the api.