Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 6 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 4.125 |
Changes | 0 |
1 | <?php namespace App\Http\Middleware; |
||
17 | 6 | public function handle(Request $request, \Closure $next) |
|
18 | { |
||
19 | 6 | if (app('auth.driver')->check()) { |
|
20 | if ($request->expectsJson()) { |
||
21 | throw new UserAlreadyLoggedInException; |
||
22 | } |
||
23 | |||
24 | return redirect('/'); |
||
25 | } |
||
26 | |||
27 | 6 | return $next($request); |
|
28 | } |
||
29 | } |
||
30 |