fix: allow logout when user are banned
This commit is contained in:
parent
cc8873ec31
commit
564672b436
@ -3,12 +3,15 @@
|
||||
namespace App\Http\Middleware;
|
||||
|
||||
use App\Models\User;
|
||||
use Closure;
|
||||
|
||||
class RejectBannedUser
|
||||
{
|
||||
public function handle($request, Closure $next)
|
||||
public function handle($request, \Closure $next)
|
||||
{
|
||||
if ($request->is('auth/logout')) {
|
||||
return $next($request);
|
||||
}
|
||||
|
||||
if ($request->user()->permission == User::BANNED) {
|
||||
if ($request->expectsJson()) {
|
||||
$response = json(trans('auth.check.banned'), -1);
|
||||
|
Loading…
Reference in New Issue
Block a user