DEV Community

Discussion on: Build a JWT Authenticated API with Lumen(v5.8)

Collapse
 
wmazed profile image
Walid Yacine MAZED • Edited

First of all great tutorial, thanks a lot for all your efforts dude, I've a question, how can I set a remember me system with JWT token ? And also, how to increase expiration duration from the config file (config/auth.php) ?

Collapse
 
wmazed profile image
Walid Yacine MAZED

For the second part of the question, the answer should be:
github.com/tymondesigns/jwt-auth/b...

Collapse
 
ndiecodes profile image
Ndifreke Friday • Edited

Would there be a need for remember me? As long as the client has the token; they have access to the system.

You could extend token's time to live for those type of users, that could work...I think.

Override the token ttl
$token = auth()->setTTL(7200)->attempt($credentials);

Further Reading
stackoverflow.com/questions/236038...

Collapse
 
wmazed profile image
Walid Yacine MAZED • Edited

Thanks dude, I've another question please, if the token is stocked localy, then yo access protected area I've check the user token for that, if Auth::user() did the job, why we stock the token localy ?