From 5272cb204962612909a35117301ea047ffede63e Mon Sep 17 00:00:00 2001 From: drkthunder02 Date: Sun, 15 Mar 2026 21:40:25 -0500 Subject: [PATCH] testing --- app/Http/Middleware/RequireRole.php | 6 +----- bootstrap/app.php | 2 -- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/app/Http/Middleware/RequireRole.php b/app/Http/Middleware/RequireRole.php index c0a0661..b5c632a 100644 --- a/app/Http/Middleware/RequireRole.php +++ b/app/Http/Middleware/RequireRole.php @@ -26,11 +26,7 @@ class RequireRole $ranking[$r->role] = $r->rank; } - $check = UserRole::where('character_id', auth()->user()->character_id)->get(); - if($check->isEmpty()) { - abort(403, "No users found in the database"); - return $next($request); - } + $check = UserRole::where('character_id', auth()->user()->character_id)->get(['role']); if(!isset($check[0]->role)) { abort(403, "You don't have any roles."); diff --git a/bootstrap/app.php b/bootstrap/app.php index 9548a8e..4ef6bf1 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -13,8 +13,6 @@ return Application::configure(basePath: dirname(__DIR__)) ->withMiddleware(function (Middleware $middleware): void { $middleware->append([ \App\Http\Middleware\RedirectIfAuthenticated::class, - \App\Http\Middleware\RequireRole::class, - \App\Http\Middleware\RequirePermission::class, \App\Http\Middleware\RefreshUserJwt::class, ]);