diff --git a/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php b/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php index c60b9e1a..2e4aa8ab 100644 --- a/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php +++ b/app/Http/Controllers/Api/Remote/Servers/ServerDetailsController.php @@ -83,9 +83,7 @@ class ServerDetailsController extends Controller */ public function list(Request $request) { - $authorization = substr($request->header('Authorization'), 7); - - $node = $this->nodeRepository->findFirstWhere(['daemonSecret' => $authorization]); + $node = $request->attributes->get('node'); $servers = $this->repository->loadEveryServerForNode($node->id); $configurations = []; diff --git a/app/Http/Middleware/Api/Daemon/DaemonAuthenticate.php b/app/Http/Middleware/Api/Daemon/DaemonAuthenticate.php index 8735c8d2..a2b1e716 100644 --- a/app/Http/Middleware/Api/Daemon/DaemonAuthenticate.php +++ b/app/Http/Middleware/Api/Daemon/DaemonAuthenticate.php @@ -69,7 +69,7 @@ class DaemonAuthenticate // Ensure that all of the correct parts are provided in the header. if (count($parts) !== 2 || empty($parts[0]) || empty($parts[1])) { throw new BadRequestHttpException( - 'The Authorization headed provided was not in a valid format.', + 'The Authorization headed provided was not in a valid format.' ); }