- Repaired a bad authentiation config

This commit is contained in:
Dave Mc Nicoll 2023-11-27 13:02:20 -05:00
parent 2378245dbf
commit 2a18e0cb9a
4 changed files with 7 additions and 7 deletions

View File

@ -30,7 +30,7 @@ return [
return HttpFactory::createJsonResponse($errorData + [ return HttpFactory::createJsonResponse($errorData + [
'api.error' => "Authorization failed", 'api.error' => "Authorization failed",
'api.datetime' => (new \DateTime)->format(\DateTime::ATOM), 'api.datetime' => (new \DateTime)->format(\DateTime::ATOM),
]); ], 401);
}; };
}, },
@ -40,7 +40,7 @@ return [
'title' => "Authentication failed", 'title' => "Authentication failed",
'subtitle' => "", 'subtitle' => "",
'message' => $message, 'message' => $message,
])); ]), 401);
}; };
}, },
]; ];

View File

@ -50,8 +50,8 @@ return [
], ],
'app.middlewares' => [ 'app.middlewares' => [
HeaderAuthenticationMiddleware::class, # HeaderAuthenticationMiddleware::class,
PostRequestAuthenticationMiddleware::class, # PostRequestAuthenticationMiddleware::class,
], ],
'routes.list' => function($c) { 'routes.list' => function($c) {

View File

@ -33,7 +33,7 @@ class HttpFactory
return new EmptyResponse($code, $headers); return new EmptyResponse($code, $headers);
} }
public static function createPdfResponse(\Stringable $binary, int $code = 200, array $headers = []) : ResponseInterface public static function createPdfResponse(\Stringable|string $binary, int $code = 200, array $headers = []) : ResponseInterface
{ {
return new PdfResponse((string) $binary, $code, $headers); return new PdfResponse((string) $binary, $code, $headers);
} }

View File

@ -154,8 +154,8 @@ class Lean
{ {
$path = dirname(__DIR__) . "/meta/definitions/"; $path = dirname(__DIR__) . "/meta/definitions/";
return array_replace( return array_merge(
require($path . "authorize.php"), require($path . "authorize.php"),
class_exists(\Mcnd\CLI\CliMiddleware::class) ? require($path . "cli.php") : [], class_exists(\Mcnd\CLI\CliMiddleware::class) ? require($path . "cli.php") : [],
class_exists(\Cronard\CronardMiddleware::class) ? require($path . "cronard.php") : [], class_exists(\Cronard\CronardMiddleware::class) ? require($path . "cronard.php") : [],
require($path . "email.php"), require($path . "email.php"),