codecasts / laravel-jwt

Dead simple, plug and play JWT API Authentication for Laravel (5.4+)
MIT License
234 stars 27 forks source link

Genarate token for never expirate #28

Closed Flavioamorim closed 6 years ago

Flavioamorim commented 6 years ago

Hi folks,

I've implemented this lib in my project, but i had a problem: i want to generate a token that never expires, but i haven't found a way to do it

thanks

hernandev commented 6 years ago

Just set the custom claim to null or the ttl config to a huge amount of minutes.

hernandev commented 6 years ago

Were you able to achieve this?

on config/jwt.php:

    /*
    |--------------------------------------------------------------------------
    | JWT Time to live (TTL)
    |--------------------------------------------------------------------------
    |
    | ...
    |
    */
    'ttl'  => 5256000,

This would allow a 10 year valid token.

Just notice, that I strongly discourage you to do it.

Flavioamorim commented 6 years ago

yes, thanks