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