Compare commits
No commits in common. "81e124b144b4d5a1d67ae96f05b648ef4e1c5927" and "01d48463b318d2174f8391e30b7f8da62e49717a" have entirely different histories.
81e124b144
...
01d48463b3
@ -4,7 +4,6 @@ use Lean\Factory\HttpFactoryInterface;
|
|||||||
|
|
||||||
use Ulmus\User\{Authorize\HeaderAuthentication,
|
use Ulmus\User\{Authorize\HeaderAuthentication,
|
||||||
Entity,
|
Entity,
|
||||||
|
|
||||||
Lib\Authenticate,
|
Lib\Authenticate,
|
||||||
Lib\Authorize,
|
Lib\Authorize,
|
||||||
Middleware\AuthenticationMiddleware,
|
Middleware\AuthenticationMiddleware,
|
||||||
@ -13,12 +12,12 @@ use Ulmus\User\{Authorize\HeaderAuthentication,
|
|||||||
Authorize\PostRequestAuthentication};
|
Authorize\PostRequestAuthentication};
|
||||||
|
|
||||||
use Picea\Picea;
|
use Picea\Picea;
|
||||||
|
|
||||||
use Storage\{ Cookie, Session };
|
use Storage\{ Cookie, Session };
|
||||||
|
|
||||||
use Psr\Container\ContainerInterface;
|
use Psr\Container\ContainerInterface;
|
||||||
|
|
||||||
use function DI\{get, autowire, create};
|
use function DI\{get, autowire, create};
|
||||||
|
|
||||||
|
|
||||||
return [
|
return [
|
||||||
Authorize::class => create(Authorize::class)->constructor(get(Entity\UserInterface::class), get(Session::class), get(Cookie::class), get('authentication.method')),
|
Authorize::class => create(Authorize::class)->constructor(get(Entity\UserInterface::class), get(Session::class), get(Cookie::class), get('authentication.method')),
|
||||||
|
|
||||||
@ -48,7 +47,6 @@ return [
|
|||||||
'authentication.error' => function($c, Picea $picea) {
|
'authentication.error' => function($c, Picea $picea) {
|
||||||
return function($message) use ($c, $picea) {
|
return function($message) use ($c, $picea) {
|
||||||
return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml('lean/error/500', [
|
return $c->get(HttpFactoryInterface::class)::createHtmlResponse($picea->renderHtml('lean/error/500', [
|
||||||
|
|
||||||
'title' => "Authentication failed",
|
'title' => "Authentication failed",
|
||||||
'subtitle' => "",
|
'subtitle' => "",
|
||||||
'message' => $message,
|
'message' => $message,
|
||||||
|
|||||||
@ -1,13 +1,3 @@
|
|||||||
<?php
|
<?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");
|
return require("env/" . ( getenv('APP_ENV') ?? 'prod' ) . ".php");
|
||||||
@ -32,6 +32,7 @@ class ApplicationStrategy extends Strategy\ApplicationStrategy {
|
|||||||
public function getThrowableHandler(): MiddlewareInterface
|
public function getThrowableHandler(): MiddlewareInterface
|
||||||
{
|
{
|
||||||
return $this->getContainer()->get(ThrowableHandlerInterface::class);
|
return $this->getContainer()->get(ThrowableHandlerInterface::class);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface
|
public function getMethodNotAllowedDecorator(MethodNotAllowedException $exception): MiddlewareInterface
|
||||||
|
|||||||
@ -63,6 +63,6 @@ class HttpFactory implements HttpFactoryInterface
|
|||||||
|
|
||||||
public static function createStream(string $content): StreamInterface
|
public static function createStream(string $content): StreamInterface
|
||||||
{
|
{
|
||||||
return new StreamFactory()->createStream($content);
|
return (new StreamFactory())->createStream($content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,4 +18,4 @@ interface HttpFactoryInterface
|
|||||||
public static function createImageResponse(string $data, int $code = 200, array $headers = []) : ResponseInterface;
|
public static function createImageResponse(string $data, int $code = 200, array $headers = []) : ResponseInterface;
|
||||||
public static function createFileDownloadResponse(string $path, int $code = 200, array $headers = []) : ResponseInterface;
|
public static function createFileDownloadResponse(string $path, int $code = 200, array $headers = []) : ResponseInterface;
|
||||||
public static function createStream(string $content) : StreamInterface;
|
public static function createStream(string $content) : StreamInterface;
|
||||||
}
|
}
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
|
Before Width: | Height: | Size: 40 KiB After Width: | Height: | Size: 40 KiB |
Loading…
x
Reference in New Issue
Block a user