Compare commits
12 Commits
01d48463b3
...
81e124b144
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
81e124b144 | ||
|
|
9cd6f10d7e | ||
|
|
a36dbeeef2 | ||
| 7ed88ec89f | |||
| c6e9bb6a38 | |||
|
|
e934c1a92c | ||
| baf6fdf952 | |||
|
|
e0da7ae734 | ||
|
|
64f273e65c | ||
|
|
9031236930 | ||
| 7ee4b2d8bb | |||
| 06c4f46486 |
@ -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,
|
||||
|
||||
@ -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");
|
||||
@ -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
|
||||
|
||||
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user