JinWu
JinWu

Reputation: 96

What is the best way to manage Laravel passport tokens when logout?

I would like to know what is the best way to manage tokens in oauth_access_tokens tables of Laravel passport when logout users from API call?

Currently I have only set 8 hours expiration for the token, and keep all the tokens there.

Thanks for your help.

Upvotes: 3

Views: 212

Answers (2)

N Jedidiah
N Jedidiah

Reputation: 1783

php artisan passport:keys --length=512 --force # create 512 character length tokens and etecetera

Upvotes: 0

jcm
jcm

Reputation: 21

If the users logs out then maybe you should remove them. You can add a subscriber to the log out event and do it from there. Take a look at:

https://laravel.com/docs/master/events#writing-event-subscribers

Upvotes: 1

Related Questions