mirror of
https://github.com/Deutscher-Tischfussballbund/com_sportsmanager.git
synced 2026-06-10 14:37:52 +00:00
fix: use correct dependency injection for json to work
This commit is contained in:
@@ -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)
|
||||||
|
|||||||
Reference in New Issue
Block a user