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