Conditions | 4 |
Paths | 3 |
Total Lines | 10 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 5.2596 |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
34 | 15 | public function onAuthenticatedResponse(ResponseEvent $event) |
|
35 | { |
||
36 | 15 | if ($this->payload != null && $this->user != null) { |
|
37 | 7 | $expireTime = $this->payload['exp'] - time(); |
|
38 | 7 | if ($expireTime < static::REFRESH_TIME) { |
|
39 | // Refresh token |
||
40 | $jwt = $this->jwtManager->create($this->user); |
||
41 | $response = $event->getResponse(); |
||
42 | // Set cookie |
||
43 | $this->createCookie($response, $jwt); |
||
44 | } |
||
47 | } |