Files
cachet-docker/app/filters/LoginThrottlingFilter.php
2014-12-30 12:39:20 +00:00

17 lines
458 B
PHP

<?php
class LoginThrottlingFilter
{
public function filter($route, $request, $response)
{
// check if we've reached the rate limit, but don't hit the throttle yet
// we can hit the throttle later on in the if validation passes
if (!Throttle::check($request, 10, 10)) {
return Redirect::back()
->with('error', 'You have made too many login requests.');
}
return $response;
}
}