I am creating a route /user/logout
using dusterio/lumen-passport
and in the controller action i manually revoke tokens which leads to the user being logged out.
I have two options to log out a user. Revoke the token (which persists the token in the database - just sets a flag telling that the token is useless) and delete the token.
My question is simply this:
What is the best approach to manage tokens? Should i logout by deleting or by revoking?
In future, i will be using redis to store the tokens so i suppose i should delete the tokens since it doesn't make sense to persist expired data in redis server.