/**
*
* TODO: Add Recaptcha, but first:
* * add recaptcha config to newscoop preferences not in recaptcha plugin config
* * remove old recaptcha libraries
* * reenable failed logins counter here Newscoop\NewscoopBundle\Security\Http\Authentication\AuthenticationFailedHandler
* * clean code
*
* {@inheritdoc}
*/
protected function attemptAuthentication(Request $request)
{
if ($request->request->has('captcha_code', $request->query->has('captcha_code')) && \LoginAttempts::MaxLoginAttemptsExceeded()) {
if (false) {
throw new AuthenticationException($translator->trans("CAPTCHA code is not valid. Please try again.", array(), 'home'));
}
}
return parent::attemptAuthentication($request);
}