| Conditions | 4 |
| Paths | 5 |
| Total Lines | 15 |
| Code Lines | 9 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | public function authenticate($user, $request, $response) |
||
| 23 | { |
||
| 24 | $accessToken = $request->get($this->tokenParam) ?? $request->post($this->tokenParam); |
||
| 25 | if (is_string($accessToken)) { |
||
| 26 | $identity = $user->loginByAccessToken($accessToken, get_class($this)); |
||
| 27 | if ($identity !== null) { |
||
| 28 | return $identity; |
||
| 29 | } |
||
| 30 | } |
||
| 31 | if ($accessToken !== null) { |
||
| 32 | $this->handleFailure($response); |
||
| 33 | } |
||
| 34 | |||
| 35 | return null; |
||
| 36 | } |
||
| 37 | } |
||
| 38 |