The blacklisted refresh tokens are stored in a collection with a timestamp of it's expiry.
We don't need to keep a refresh token in blacklist once it's expired.
To reduce the db storage used to store the blacklisted refresh tokens, a cron job needs to be setup using node-cron to run every 24 hours, preferably at 2AM everyday to remove all the blacklisted tokens from the collection where timestamp is less than the current time.
Note: Create a src/cron directory and place the JWTBlacklistCleanup.ts inside that directory to maintain the project structure.
This issue depends on #17
Tasks
Note: Create a
src/cron
directory and place theJWTBlacklistCleanup.ts
inside that directory to maintain the project structure.