Conditions | 3 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 6 |
CRAP Score | 3 |
Changes | 0 |
1 | <?php |
||
26 | 2 | public function call(Micro $api) |
|
27 | { |
||
28 | 2 | $config = $api->getService('config'); |
|
29 | |||
30 | 2 | $auth = $api->getService('auth'); |
|
31 | // to get the payload |
||
32 | 2 | $data = $auth->data(); |
|
33 | |||
34 | 2 | if (!empty($data) && $data['iat'] <= strtotime('-10 seconds')) { |
|
35 | // return false to invalidate the authentication |
||
36 | //throw new Exception("Old Request"); |
||
37 | } |
||
38 | |||
39 | 2 | return true; |
|
40 | } |
||
42 |