| Conditions | 1 |
| Paths | 1 |
| Total Lines | 15 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 1 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 27 | 2 | protected function run( |
|
| 28 | ServerRequestInterface $request, |
||
| 29 | JsonEnabledResponseInterface $response, |
||
| 30 | array $args |
||
| 31 | ): ResponseInterface { |
||
| 32 | /** @var UserInterface $user */ |
||
| 33 | 2 | $user = $request->getAttribute(SessionValidatorMiddleware::USER); |
|
| 34 | |||
| 35 | 2 | $accessKey = $this->accessKeyRepository->findOneBy([ |
|
| 36 | 2 | 'user' => $user, |
|
| 37 | 2 | 'type_id' => AccessKeyTypeEnum::SUBSONIC, |
|
| 38 | 2 | ]); |
|
| 39 | |||
| 40 | 2 | return $response->withJson([ |
|
| 41 | 2 | 'accessToken' => $accessKey?->getConfig()[AuthenticationProvider::CONFIG_KEY_TOKEN] ?? null, |
|
| 42 | 2 | ]); |
|
| 45 |