I am new to the full stack world, so I hope that my question is not too basic..
I have a JWT tokens that saved in MongoDB, as a field in the user document.
Let's take scenario when the user deletes his browsing data and the JWT in his side is deleted and won't be in use anymore.
How can I delete the token from Mongo after a period of time without usage? In order to avoid tons of unnecessary tokens in the DB and security problems..
If it matters, I write my backend with NodeJS.