fix: use correct dependency injection for json to work

This commit is contained in:
Marvin Flock
2025-04-23 20:31:09 +02:00
parent c7e9f664e2
commit 43ebed6b39
@@ -32,7 +32,7 @@ $secret = Factory::getContainer()->get(Registry::class)->get("secret");
function isJson(): bool function isJson(): bool
{ {
$jInput = Factory::getContainer()->get(SiteApplication::class)->getInput(); $jInput = Factory::getContainer()->get(SiteApplication::class)->input;
return $jInput->get('format') === 'json'; return $jInput->get('format') === 'json';
} }
@@ -172,7 +172,7 @@ function begegnungVerlegenNotify($begegnung, $users, $vorschlagendes_team_id, $h
abortWithError("Local Database only"); abortWithError("Local Database only");
} }
$container = Factory::getContainer(); $container = Factory::getContainer();
$jInput = $container->get(SiteApplication::class)->getInput()->json; $jInput = $container->get(SiteApplication::class)->input->json;
$username = $jInput->getString('username'); $username = $jInput->getString('username');
$password = $jInput->getString('password'); $password = $jInput->getString('password');
@@ -200,7 +200,7 @@ function getUserID(): int
{ {
global $secret; global $secret;
$container = Factory::getContainer(); $container = Factory::getContainer();
$input = $container->get(Input::class); $input = $container->get(SiteApplication::class)->input;
$token = $input->server->getString('HTTP_SECRET', NULL); $token = $input->server->getString('HTTP_SECRET', NULL);
return $token != NULL && jwt_validate($token, $secret) && isset(_payload($token)->sub) return $token != NULL && jwt_validate($token, $secret) && isset(_payload($token)->sub)