diff --git a/app/Http/Middleware/CheckServer.php b/app/Http/Middleware/CheckServer.php index 808a1e8bf..85da233d5 100644 --- a/app/Http/Middleware/CheckServer.php +++ b/app/Http/Middleware/CheckServer.php @@ -25,7 +25,7 @@ class CheckServer $server = Server::getByUUID($request->route()->server); if (!$server) { - return redirect()->route('index'); + return response()->view('errors.403', [], 403); } if ($server->installed !== 1) { diff --git a/app/Models/Server.php b/app/Models/Server.php index 1075f1b86..190e989e0 100644 --- a/app/Models/Server.php +++ b/app/Models/Server.php @@ -113,7 +113,7 @@ class Server extends Model } $query = self::select('servers.*', 'services.file as a_serviceFile') - ->join('services', 'services.id', '=', 'servers.id') + ->join('services', 'services.id', '=', 'servers.service') ->where('uuidShort', $uuid)->where('active', 1); if (self::$user->root_admin !== 1) {