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