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