phudev95's avatar

How to set time expire for JWT

I must set time expire for Json web token. I read docs of package , but i don't find make set time expire for it. Tks all

0 likes
6 replies
parama.dharmika@gmail.com's avatar

There are file called jwt.php which is the config file to the package, have a look on property called ttl there and set the value.

5 likes
orozcopc's avatar

Just add in .env file JWT_TTL=1440 //24 hours

(default 60 minutes)

jaythanki's avatar

@PHUDEV95 If you want to add dynamic than you must set in .env file or you can set it directly in config/jwt.php

choose as per your requirement from 1 or 2

  1. In .env

    JWT_TTL=60 // (in minutes)

  2. In config/jwt.php

    'ttl' => env('JWT_TTL', 60) //defualt 60 (in minutes)

Please or to participate in this conversation.