Conditions | 3 |
Paths | 3 |
Total Lines | 12 |
Code Lines | 7 |
Lines | 0 |
Ratio | 0 % |
Tests | 3 |
CRAP Score | 5.1971 |
Changes | 2 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
21 | 15 | public function handle(Request $request, Closure $next, string $guard = 'admin'): Response |
|
22 | { |
||
23 | 15 | if (Auth::guard($guard)->check()) { |
|
24 | 15 | return $next($request); |
|
25 | } |
||
26 | |||
27 | $redirectToRoute = $request->expectsJson() ? '' : route('admin.login'); |
||
28 | |||
29 | throw new AuthenticationException( |
||
30 | 'Unauthenticated.', |
||
31 | [$guard], |
||
32 | $redirectToRoute |
||
33 | ); |
||
36 |