- Added an HttpFactory and beginning the removal of old annotations from Notes
This commit is contained in:
1 parent
7e92391113
commit
08c27e38b0
10 files changed
+143
-52
No files matched your search
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
|
||||
use Lean\Factory\HttpFactory;
|
||||
use \Ulmus\User\Middleware\AuthorizeMiddleware;
|
||||
|
||||
use function DI\{get, autowire, create};
|
||||
|
||||
return [
|
||||
AuthorizeMiddleware::class => create(AuthorizeMiddleware::class)->constructor(get('authorize.error')),
|
||||
|
||||
'authorize.error' => function($c) {
|
||||
return HttpFactory::createJsonResponse([
|
||||
'api.error' => "Authorization failed",
|
||||
'api.datetime' => ( new \DateTime )->format(\DateTime::ATOM),
|
||||
]);
|
||||
},
|
||||
];
|
||||
Reference in new issue
Block a user