sanchescom/lumen-login-throttling
Composer 安装命令:
composer require sanchescom/lumen-login-throttling
包简介
Lumen login throttling.
README 文档
README
Laravel Login Throttling for Lumen framework
Installing
Require this package, with Composer, in the root directory of your project.
composer require sanchescom/lumen-login-throttling
Usage
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use Sanchescom\Foundation\Auth\AuthenticatesUsers; use Laravel\Lumen\Routing\Controller; class AuthController extends Controller { use AuthenticatesUsers; /** @var int */ protected $maxAttempts = 3; /** @var int */ protected $decayMinutes = 5; /** * Handle a login request to the application. * * @param \Illuminate\Http\Request $request * * @throws \Illuminate\Validation\ValidationException * * @return mixed */ public function login(Request $request) { $this->validateLogin($request); if ($this->hasTooManyLoginAttempts($request)) { $this->fireLockoutEvent($request); return $this->sendLockoutResponse($request); } if ($this->attemptLogin($request)) { return $this->sendLoginResponse($request); } $this->incrementLoginAttempts($request); return $this->sendFailedLoginResponse($request); } }
统计信息
- 总下载量: 1.03k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 1
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2019-07-17