- WIP on adding of HttpFactory and work on authorization from Ulmus/User too

This commit is contained in:
mcndave committed 2023-11-03 19:51:39 -04:00
1 parent 1241e188e9
commit 16cd95abe2
9 files changed
+47 -55

No files matched your search

+3 -17
View File
@@ -22,29 +22,15 @@ use TheBugs\Email\{ EmailConfiguration, MailerInterface, SwiftMailer };
use Taxus\{ Taxus, PermissionGrantInterface };
return [
Entity\User::class => autowire(Entity\User::class),
Authenticate::class => create(Authenticate::class)->constructor(get(Session::class), get(Cookie::class), get('authentication.method')),
\Ulmus\User\Entity\UserInterface::class => autowire(Entity\User::class),
SecurityHandler::class => create(SecurityHandler::class)->constructor(function() {
return new RedirectResponse(getenv("URL_BASE")."/login");
return Lean\Factory\HttpFactory::createRedirectResponse(getenv("URL_BASE")."/login");
}, get('authentication.unauthorize'), get(Taxus::class)),
'authentication.method' => null,
'authentication.error' => function($c, Picea $picea) {
return function($message) use ($picea) {
return new HtmlResponse($picea->renderHtml('lean/error/500', [
'title' => "",
'subtitle' => "",
'message' => $message,
]));
};
},
'authentication.unauthorize' => function($c, Picea $picea) {
return function($message) use ($picea) {
return new HtmlResponse($picea->renderHtml('lean/error/401', [
return Lean\Factory\HttpFactory::createHtmlResponse($picea->renderHtml('lean/error/401', [
'title' => "",
'subtitle' => "",
'message' => $message,