Skip to content

Commit

Permalink
On failed authentication, GoogleAuthenticator now display proper flas…
Browse files Browse the repository at this point in the history
…h message
  • Loading branch information
shahariaazam committed May 28, 2020
1 parent 04e34bd commit 9b9a0df
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Security/GoogleAuthenticator.php
Original file line number Diff line number Diff line change
Expand Up @@ -111,9 +111,9 @@ public function onAuthenticationSuccess(Request $request, TokenInterface $token,

public function onAuthenticationFailure(Request $request, AuthenticationException $exception)
{
$message = strtr($exception->getMessageKey(), $exception->getMessageData());
$request->getSession()->getFlashBag()->add('danger', $exception->getMessage());

return new Response($message, Response::HTTP_FORBIDDEN);
return new RedirectResponse($this->router->generate('app_login'));
}

/**
Expand Down

0 comments on commit 9b9a0df

Please sign in to comment.