Conditions | 3 |
Paths | 3 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 12 |
Changes | 0 |
1 | <?php namespace App\Http\Middleware; |
||
18 | public function handle($request, \Closure $next, ...$guards) |
||
19 | { |
||
20 | try { |
||
21 | $this->authenticate($guards); |
||
22 | } catch (AuthenticationException $e) { |
||
23 | if ($request->expectsJson()) { |
||
24 | throw $e; |
||
25 | } else { |
||
26 | return redirect()->guest(route('login')); |
||
27 | } |
||
28 | } |
||
29 | |||
30 | return $next($request); |
||
31 | } |
||
32 | } |
||
33 |