我使用 jwt 和 Lumen 创建了一个身份验证 api。
我用 tymondesigns/jwt-auth
在我的 Lumen 项目中打包以进行身份验证。在用户登录时的项目中,我想在 1 个月后使用户 token 过期。
现在我该如何解决?
最佳答案
如果你跑了:php artisan vendor:publish
根据安装维基:https://github.com/tymondesigns/jwt-auth/wiki/Installation
比简单的改ttl
设置:
// In config/jwt.php
...
/*
|--------------------------------------------------------------------------
| JWT time to live
|--------------------------------------------------------------------------
|
| Specify the length of time (in minutes) that the token will be valid for.
| Defaults to 1 hour
|
*/
'ttl' => 43800, // valid for 1 month
...
关于laravel - 在 lumen jwt token 中设置过期时间,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36665489/