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