@@ -5,7 +5,6 @@ |
||
5 | 5 | use Doctrine\Common\Collections\ArrayCollection; |
6 | 6 | use Doctrine\ORM\Mapping as ORM; |
7 | 7 | use Knp\DoctrineBehaviors\Model as ORMBehaviors; |
8 | -use Symfony\Component\Validator\Constraints as Assert; |
|
9 | 8 | |
10 | 9 | /** |
11 | 10 | * Event |
@@ -7,7 +7,6 @@ |
||
7 | 7 | use Doctrine\ORM\EntityManager; |
8 | 8 | use Symfony\Component\HttpFoundation\JsonResponse; |
9 | 9 | use Symfony\Component\HttpFoundation\Request; |
10 | -use Symfony\Component\HttpFoundation\Response; |
|
11 | 10 | use Symfony\Component\Security\Core\Authentication\Token\TokenInterface; |
12 | 11 | use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException; |
13 | 12 | use Symfony\Component\Security\Core\Exception\AuthenticationException; |
@@ -20,13 +20,13 @@ |
||
20 | 20 | { |
21 | 21 | $user = $this->getDoctrine()->getRepository('AppBundle:UserIntern') |
22 | 22 | ->findOneBy(['userName' => $request->get('login')]); |
23 | - if (!$user){ |
|
23 | + if (!$user) { |
|
24 | 24 | return new JsonResponse(['message' => 'Bad credentials'], 403); |
25 | 25 | } |
26 | 26 | $result = $this->get('security.encoder_factory') |
27 | 27 | ->getEncoder($user) |
28 | 28 | ->isPasswordValid($user->getPassword(), $request->get('password'), null); |
29 | - if (!$result){ |
|
29 | + if (!$result) { |
|
30 | 30 | return new JsonResponse(['message' => 'Bad credentials'], 403); |
31 | 31 | } |
32 | 32 |