Hello again, I would like to know if is there a way to make dynamic ttl in jwt. In my API I setted it to 300 minutes and works well, but I want to change it and set to null (infinite) just in my mobile app. So I will create a mobile auth endpoint, and just at this endpoint I want to set another ttl.
I know that I can change in config/jwt.php but it will change for all.
How could I do it ?
Im having the same doubt.. any answers for this??
I could use this functionality too. Would be nice to be able to overwrite/set the attributes just before making the token perhaps?
// Overwrite jwt config settings, for this execution of php/laravel framework
JWTAuth::setTTL(60);
// Then create the token?
JWTAuth::
$token = JWTAuth::fromUser($customer);
Or is something like this already possible? I haven't been able to find it yet
Have you found the solution to this.
JWTAuth::factory()->setTTL($n);
JWTAuth::factory()->setRefreshTTL($m);
also now with the new version you can do something like
$token = auth()->setTTL(120)->login($user)
how work with 1.0.0-rc.1? @sleenen
@Insua haven't tried it yet, but I will soon work on implementing latest version when upgrading to L5.6
Most helpful comment
also now with the new version you can do something like
$token = auth()->setTTL(120)->login($user)