Conditions | 3 |
Paths | 3 |
Total Lines | 16 |
Code Lines | 8 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php |
||
27 | public function run() |
||
28 | { |
||
29 | $config = $this->container->getConfig()->jwt->toArray(); |
||
30 | |||
31 | //if the router has jwt ignore url we always overwrite the app config |
||
32 | $routerJwtIgnoreUrl = RouterCollection::getJwtIgnoreRoutes(); |
||
33 | if (!empty($routerJwtIgnoreUrl)) { |
||
34 | $config['ignoreUri'] = $routerJwtIgnoreUrl; |
||
35 | } elseif (!$this->container->getConfig()->application->jwtSecurity) { |
||
36 | //ignore token validation if disable |
||
37 | $config['ignoreUri'] = ['regex: *']; |
||
38 | } |
||
39 | //JWT Validation |
||
40 | new AuthMicro($this->application, $config); |
||
41 | |||
42 | return $this->application->handle($this->container->getRequest()->getServer('request_uri', null, '/')); |
||
43 | } |
||
59 |