简体   繁体   English

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

[英]Make Account Lock (Laravel 5.7) Auth

How to make Account Locked and lock the user after X minutes of inactivity. 闲置X分钟后如何使Account Locked并锁定用户。 And make him/her to write password and re-login. 并让他/她输入密码并重新登录。 How can I do that? 我怎样才能做到这一点? Do I need to do with making new method in Auth\\LoginController or what? 我需要在Auth\\LoginController创建新方法还是做什么? Help. 救命。

This feature is already included in Laravel. Laravel已包含此功能。 Have a look at the configuration file config/session.php . 看看配置文件config/session.php It contains a configuration key called lifetime which is exactly what you are looking for: 它包含一个称为“ 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),

As you can see, the setting can also be set via the environment variable SESSION_LIFETIME . 如您所见,也可以通过环境变量SESSION_LIFETIME进行设置。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM