| Conditions | 5 |
| Paths | 3 |
| Total Lines | 16 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 49 | public function handle($request, Closure $next) |
||
| 50 | { |
||
| 51 | $user = $this->auth->user(); |
||
| 52 | |||
| 53 | if ($user && $user instanceof BannableContract && $user->isBanned()) { |
||
| 54 | if ($this->auth instanceof StatefulGuardContract) { |
||
| 55 | // TODO: Cover with tests |
||
| 56 | $this->auth->logout(); |
||
| 57 | } |
||
| 58 | |||
| 59 | return redirect()->back()->withInput()->withErrors([ |
||
| 60 | 'login' => 'This account is blocked.', |
||
| 61 | ]); |
||
| 62 | } |
||
| 63 | |||
| 64 | return $next($request); |
||
| 65 | } |
||
| 67 |