Completed
Pull Request — development (#795)
by Nick
04:52
created

SecurityController::logout()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
4
namespace Oc\Security;
5
6
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
7
use Symfony\Component\HttpFoundation\Response;
8
use Symfony\Component\Routing\Annotation\Route;
9
use Symfony\Component\Security\Http\Authentication\AuthenticationUtils;
10
11
class SecurityController extends AbstractController
12
{
13
    /**
14
     * @Route("/login", name="app_login")
15
     */
16
    public function login(AuthenticationUtils $authenticationUtils): Response
17
    {
18
        // if ($this->getUser()) {
19
        //     return $this->redirectToRoute('target_path');
20
        // }
21
22
        // get the login error if there is one
23
        $error = $authenticationUtils->getLastAuthenticationError();
24
        // last username entered by the user
25
        $lastUsername = $authenticationUtils->getLastUsername();
26
27
        return $this->render('security/login.html.twig', [
28
            'last_username' => $lastUsername,
29
            'error' => $error
30
        ]);
31
    }
32
33
    /**
34
     * @Route("/logout", name="app_logout")
35
     */
36
    public function logout()
37
    {
38
    }
39
}
40