Skip to content

Commit

Permalink
ci: middleware structure has been modified in config/
Browse files Browse the repository at this point in the history
  • Loading branch information
Sleon4 committed Jul 11, 2023
1 parent 044d46a commit 1d25091
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/Traits/Framework/Index.php
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public function loadRoutes(array $middleware, string $routes): void {
Route::addLog();
Route::init();
LionRouteRequest::init(client);
Route::addMiddleware($middleware);
Route::addMiddleware([...$middleware['framework'], ...$middleware['app']]);
include_once($routes);
Route::get('route-list', fn() => Route::getFullRoutes());
session()->destroy();
Expand Down
15 changes: 10 additions & 5 deletions config/middleware.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,15 @@
**/

return [
\App\Http\Middleware\Framework\JWTMiddleware::class => [
['name' => "jwt-existence", 'method' => "existence"],
['name' => "jwt-authorize", 'method' => "authorize"],
['name' => "jwt-not-authorize", 'method' => "notAuthorize"],
['name' => "jwt-without-signature", 'method' => "authorizeWithoutSignature"]
'app' => [
//
],
'framework' => [
\App\Http\Middleware\Framework\JWTMiddleware::class => [
['name' => "jwt-existence", 'method' => "existence"],
['name' => "jwt-authorize", 'method' => "authorize"],
['name' => "jwt-not-authorize", 'method' => "notAuthorize"],
['name' => "jwt-without-signature", 'method' => "authorizeWithoutSignature"]
]
],
];

0 comments on commit 1d25091

Please sign in to comment.