@@ -37,7 +37,7 @@ |
||
37 | 37 | |
38 | 38 | |
39 | 39 | return new Passport( |
40 | - new UserBadge($apiToken, function ($apiToken) { |
|
40 | + new UserBadge($apiToken, function($apiToken) { |
|
41 | 41 | $user = $this->em->getRepository(User::class)->findOneBy(['apiKey' => $apiToken]); |
42 | 42 | if (null === $user) |
43 | 43 | throw new CustomUserMessageAuthenticationException('Invalid API token'); |
@@ -32,15 +32,17 @@ |
||
32 | 32 | public function authenticate(Request $request): Passport |
33 | 33 | { |
34 | 34 | $apiToken = $this->getKey($request); |
35 | - if (null === $apiToken) |
|
36 | - throw new CustomUserMessageAuthenticationException('No API token provided'); |
|
35 | + if (null === $apiToken) { |
|
36 | + throw new CustomUserMessageAuthenticationException('No API token provided'); |
|
37 | + } |
|
37 | 38 | |
38 | 39 | |
39 | 40 | return new Passport( |
40 | 41 | new UserBadge($apiToken, function ($apiToken) { |
41 | 42 | $user = $this->em->getRepository(User::class)->findOneBy(['apiKey' => $apiToken]); |
42 | - if (null === $user) |
|
43 | - throw new CustomUserMessageAuthenticationException('Invalid API token'); |
|
43 | + if (null === $user) { |
|
44 | + throw new CustomUserMessageAuthenticationException('Invalid API token'); |
|
45 | + } |
|
44 | 46 | |
45 | 47 | return $user; |
46 | 48 | }), |