是否可以使用Laravel的Authenticating A User With Conditions来防止暴力攻击?在Laravel验证用户时防止暴力攻击
这个answer for PHP,建议在您的数据库中添加两列(TimeOfLastFailedLogin
和NumberOfFailedAttempts
),然后在每次登录尝试时检查这些值。
这里是Laravel的语法与条件验证用户的身份:
if (Auth::attempt(array('email' => $email, 'password' => $password, 'active' => 1)))
{
// The user is active, not suspended, and exists.
}
有没有办法使用条件参数来检查尝试的次数对指定的时间段?例如,在最近60秒内少于3次的请求。