I know I can set sanctum token expiration time in config/sanctum.php but this expiration seems to be global. How can I set a different expiration time base on their role. e.g super admin token should expire after 30 minutes while admin should expire after 15 minute.
Asked
Active
Viewed 118 times
1 Answers
0
While authenticating a user, You can dynamically set 'expiration' key of sanctum configuration based on your user type.
config(['sanctum.expiration' => 525600]);

Tanvir Hossain
- 11
- 2
- 2
-
Please where do I use this code in my laravel application – emmy felico Aug 12 '22 at 07:19