Total Complexity | 4 |
Total Lines | 37 |
Duplicated Lines | 0 % |
Coverage | 0% |
Changes | 0 |
1 | <?php |
||
20 | class Swoole extends AbstractBootstrap |
||
21 | { |
||
22 | /** |
||
23 | * Run the application |
||
24 | * |
||
25 | * @return mixed |
||
26 | */ |
||
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 | } |
||
44 | |||
45 | /** |
||
46 | * @return mixed |
||
47 | */ |
||
48 | public function setup() |
||
57 | } |
||
58 | } |
||
59 |