Passed
Push — main ( bfbca3...f1aa52 )
by Karl
08:21
created

SecurityController::logout()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 1
Metric Value
eloc 2
c 1
b 0
f 1
dl 0
loc 4
rs 10
cc 1
nc 1
nop 0
1
<?php
2
3
namespace App\Controller\Kassabok;
4
5
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
6
use Symfony\Component\HttpFoundation\Response;
7
use Symfony\Component\Routing\Attribute\Route;
8
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
9
10
class SecurityController extends AbstractController
11
{
12
    #[Route(path: '/proj/login', name: 'kassabok_login')]
13
    public function login(AuthenticationUtils $authenticationUtils): Response
14
    {
15
        // get the login error if there is one
16
        $error = $authenticationUtils->getLastAuthenticationError();
17
18
        // last username entered by the user
19
        $lastUsername = $authenticationUtils->getLastUsername();
20
21
        return $this->render('kassabok/security/login.html.twig', [
22
            'last_username' => $lastUsername,
23
            'error' => $error,
24
        ]);
25
    }
26
27
    #[Route(path: '/proj/logout', name: 'kassabok_logout')]
28
    public function logout(): void
29
    {
30
        throw new \LogicException('This method can be blank - it will be intercepted by the logout key on your firewall.');
31
    }
32
}
33