Fix trailing comma in DaemonAuthenticate.php, change ServerDetailsController.php to use node authentication

This commit is contained in:
Matthew Penner 2020-04-10 17:54:50 -06:00
parent a37e30cd49
commit 658a959e5d
2 changed files with 2 additions and 4 deletions

View file

@ -83,9 +83,7 @@ class ServerDetailsController extends Controller
*/ */
public function list(Request $request) public function list(Request $request)
{ {
$authorization = substr($request->header('Authorization'), 7); $node = $request->attributes->get('node');
$node = $this->nodeRepository->findFirstWhere(['daemonSecret' => $authorization]);
$servers = $this->repository->loadEveryServerForNode($node->id); $servers = $this->repository->loadEveryServerForNode($node->id);
$configurations = []; $configurations = [];

View file

@ -69,7 +69,7 @@ class DaemonAuthenticate
// Ensure that all of the correct parts are provided in the header. // Ensure that all of the correct parts are provided in the header.
if (count($parts) !== 2 || empty($parts[0]) || empty($parts[1])) { if (count($parts) !== 2 || empty($parts[0]) || empty($parts[1])) {
throw new BadRequestHttpException( throw new BadRequestHttpException(
'The Authorization headed provided was not in a valid format.', 'The Authorization headed provided was not in a valid format.'
); );
} }