12 Commits
4 changed files with 15 additions and 4 deletions

No files matched your search

+4 -2
View File
@@ -4,6 +4,7 @@ use Lean\Factory\HttpFactoryInterface;
use Ulmus\User\{Authorize\HeaderAuthentication,
Entity,
Lib\Authenticate,
Lib\Authorize,
Middleware\AuthenticationMiddleware,
@@ -12,12 +13,12 @@ use Ulmus\User\{Authorize\HeaderAuthentication,
Authorize\PostRequestAuthentication};
use Picea\Picea;
use Storage\{ Cookie, Session };
use Psr\Container\ContainerInterface;
use function DI\{get, autowire, create};
return [
Authorize::class => create(Authorize::class)->constructor(get(Entity\UserInterface::class), get(Session::class), get(Cookie::class), get('authentication.method')),
@@ -47,6 +48,7 @@ return [
'authentication.error' => function($c, Picea $picea) {
return function($message) use ($c, $picea) {
return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml('lean/error/500', [
'title' => "Authentication failed",
'subtitle' => "",
'message' => $message,
+10
View File
@@ -1,3 +1,13 @@
<?php
if (! function_exists('getenvonce')) {
function getenvonce(string $name) : array|string|false
{
$value = getenv($name);
unset($_ENV[$name], $_SERVER[$name]);
putenv($name . "=");
return $value;
}
}
return require("env/" . ( getenv('APP_ENV') ?? 'prod' ) . ".php");
-1
View File
@@ -32,7 +32,6 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy {
public function getThrowableHandler(): MiddlewareInterface
{
return $this->getContainer()->get(ThrowableHandlerInterface::class);
}
public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface
+1 -1
View File
@@ -63,6 +63,6 @@ class HttpFactory implements HttpFactoryInterface
public static function createStream(string $content): StreamInterface
{
return (new StreamFactory())->createStream($content);
return new StreamFactory()->createStream($content);
}
}