Reputation: 696
I am developing mobile application back-end service using laravel 5.3. I am following REST API. Application having payment gateway integration and it needs more security.
I followed jwt auth by using the tymon/jwt-auth
library for laravel.
I have few concern, my token getting expired after 1 hour, after that server returning token expired error and how application developer can handle this situation? Asking user to log in, again and again, is not possible.
How can app developer handle it?
What is the best and more secure approach?
Upvotes: 1
Views: 3235
Reputation: 734
in config/jwt.php
change 'ttl' => 60
to whatever number you need, the numbers represent the minutes a token can live, but the best approach is to use the RefreshToken
, since your app will be more secure from unwanted users.
Upvotes: 2