| Conditions | 3 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 5 | ||
| Bugs | 0 | Features | 0 |
| 1 | <?php |
||
| 11 | public function handle($request, Closure $next) |
||
| 12 | { |
||
| 13 | $defaultGuard = config('easy_panel.auth_guard') ?? config('auth.defaults.guard'); |
||
| 14 | $redirectPath = config('easy_panel.redirect_unauthorized') ?? '/'; |
||
| 15 | |||
| 16 | auth()->shouldUse($defaultGuard); |
||
| 17 | |||
| 18 | if(auth()->guest()){ |
||
| 19 | return redirect($redirectPath); |
||
| 20 | } |
||
| 21 | |||
| 22 | if(!AuthFacade::check(auth()->user()->id)){ |
||
| 23 | return redirect($redirectPath); |
||
| 24 | } |
||
| 25 | |||
| 26 | return $next($request); |
||
| 27 | } |
||
| 30 |