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