Conditions | 6 |
Paths | 3 |
Total Lines | 17 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 7 |
CRAP Score | 6.0702 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
41 | 28 | public function handle($request, Closure $next) |
|
42 | { |
||
43 | 28 | if ($this->auth->check() && $this->router->current()->getActionName() != $this->config->get('expendable.logout_action')) |
|
44 | { |
||
45 | 2 | $menu = $this->config->get('expendable.menu'); |
|
46 | 2 | $user = $this->auth->user(); |
|
47 | |||
48 | 2 | if (method_exists($user, 'getFirstRedirect') && !empty($menu) && !empty($menu['left'])) |
|
49 | { |
||
50 | 2 | return new RedirectResponse($this->auth->user()->getFirstRedirect($menu['left'])); |
|
51 | } |
||
52 | |||
53 | return new RedirectResponse('/'); |
||
54 | |||
55 | } |
||
56 | |||
57 | 26 | return $next($request); |
|
58 | } |
||
59 | } |