| Conditions | 2 |
| Paths | 2 |
| Total Lines | 15 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2 |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php declare(strict_types=1); |
||
| 22 | 4 | public function retrieveByCredentials(array $credentials) |
|
| 23 | { |
||
| 24 | 4 | $token = $credentials['cognito_token']; |
|
| 25 | |||
| 26 | try { |
||
| 27 | 4 | $payload = $this->parser->parse($token); |
|
| 28 | |||
| 29 | 1 | } catch (Exception $e) { |
|
| 30 | // If we cannot parse the token, that probably means it's an invalid Token. Since |
||
| 31 | // the Authenticate Middleware implements a Chain Of Responsibility Pattern, |
||
| 32 | // we have to return null so that other Guards can try to authenticate. |
||
| 33 | 1 | return null; |
|
| 34 | } |
||
| 35 | |||
| 36 | 3 | return $this->factory->make($payload); |
|
| 37 | } |
||
| 59 |