- WIP on adding of HttpFactory and work on authorization from Ulmus/User too
This commit is contained in:
1 parent
1241e188e9
commit
16cd95abe2
9 files changed
+47
-55
No files matched your search
@@ -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,
|
||||
|
||||
Reference in new issue
Block a user