| Conditions | 5 |
| Paths | 4 |
| Total Lines | 17 |
| Code Lines | 11 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 12 | public function respondToRequest(ServerRequestInterface $request, ResponseInterface $response): ResponseInterface |
||
| 13 | { |
||
| 14 | $client = $this->validateClient($request); |
||
| 15 | [$tokenType, $tokenData] = $this->validateToken($request, $client); |
||
| 16 | |||
| 17 | if ($tokenType !== null && $tokenData !== null) { |
||
| 18 | if ($tokenType === 'refresh_token') { |
||
| 19 | $this->refreshTokenRepository->revokeRefreshToken($tokenData['refresh_token_id']); |
||
| 20 | $this->accessTokenRepository->revokeAccessToken($tokenData['access_token_id']); |
||
| 21 | } elseif ($tokenType === 'access_token') { |
||
| 22 | $this->accessTokenRepository->revokeAccessToken($tokenData['jti']); |
||
| 23 | } |
||
| 24 | } |
||
| 25 | |||
| 26 | return $response |
||
|
|
|||
| 27 | ->withStatus(200) |
||
| 28 | ->withHeader('cache-control', 'no-store'); |
||
| 29 | } |
||
| 31 |