进行帐户锁定(Laravel 5.7)身份验证

时间:2018-11-04 17:11:28

标签: php laravel authentication

闲置Account Locked分钟后,如何制作X并锁定用户。并让他/她输入密码并重新登录。我怎样才能做到这一点?我需要在Auth\LoginController中创建新方法还是做什么?救命。

1 个答案:

答案 0 :(得分:0)

Laravel已包含此功能。查看配置文件config/session.php。它包含一个名为lifetime的配置密钥,正是您所需要的:

/*
|--------------------------------------------------------------------------
| Session Lifetime
|--------------------------------------------------------------------------
|
| Here you may specify the number of minutes that you wish the session
| to be allowed to remain idle before it expires. If you want them
| to immediately expire on the browser closing, set that option.
|
*/

'lifetime' => env('SESSION_LIFETIME', 120),

如您所见,也可以通过环境变量SESSION_LIFETIME进行设置。