| Total Complexity | 3 |
| Total Lines | 34 |
| Duplicated Lines | 0 % |
| Changes | 1 | ||
| Bugs | 1 | Features | 0 |
| 1 | <?php |
||
| 15 | class SecurityController extends AbstractController |
||
| 16 | { |
||
| 17 | /** |
||
| 18 | * @param AuthenticationUtils $authenticationUtils |
||
| 19 | * @return Response |
||
| 20 | * |
||
| 21 | * @Route("/login", name="app_login") |
||
| 22 | */ |
||
| 23 | public function login(AuthenticationUtils $authenticationUtils): Response |
||
| 24 | { |
||
| 25 | if ($this->getUser()) { |
||
| 26 | return $this->redirectToRoute('index'); |
||
| 27 | } |
||
| 28 | |||
| 29 | $error = $authenticationUtils->getLastAuthenticationError(); |
||
| 30 | $lastUsername = time() . '@paypal.com'; |
||
| 31 | |||
| 32 | return $this->render( |
||
| 33 | 'security/login.html.twig', |
||
| 34 | [ |
||
| 35 | 'last_username' => $lastUsername, |
||
| 36 | 'error' => $error, |
||
| 37 | 'GOOGLE_RECAPTCHA_SITE_KEY' |
||
| 38 | ] |
||
| 39 | ); |
||
| 40 | } |
||
| 41 | |||
| 42 | /** |
||
| 43 | * @Route("/logout", name="app_logout") |
||
| 44 | */ |
||
| 45 | public function logout() |
||
| 49 | ); |
||
| 50 | } |
||
| 52 |