| Conditions | 3 |
| Paths | 3 |
| Total Lines | 14 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 3 |
| CRAP Score | 3 |
| Changes | 5 | ||
| Bugs | 2 | Features | 1 |
| 1 | <?php |
||
| 33 | public function handle(Request $request, Closure $next) |
||
| 34 | { |
||
| 35 | if ($this->auth->guest()) { |
||
| 36 | if ($request->ajax()) { |
||
| 37 | 57 | abort(401); |
|
| 38 | } |
||
| 39 | 57 | ||
| 40 | 57 | return redirect()->guest('/'); |
|
| 41 | } |
||
| 42 | |||
| 43 | app()->setLocale($this->getLoggedUser()->language); |
||
| 44 | |||
| 45 | return $next($request); |
||
| 46 | } |
||
| 47 | } |
||
| 48 |