feat: implement JWT-based authentication system with repository, service, and middleware layers

This commit is contained in:
2026-09-09 20:02:55 -03:00
parent f6d7d42f10
commit 14b85d28a1
11 changed files with 975 additions and 2 deletions
+14 -2
View File
@@ -20,7 +20,7 @@ KrothiumAPI::init(config: [
'root' => __DIR__ . '/..',
'src' => __DIR__ . '/../app',
'module' => __DIR__ . '/../app/Module',
'storage' => __DIR__ . '/var/www/workbloomerp-api/storage',
'storage' => __DIR__ . '/../storage',
'component' => __DIR__ . '/../app/Common/Component',
],
'router' => [
@@ -43,7 +43,19 @@ KrothiumAPI::init(config: [
]
]);
// Importa rotas da API v0
// ======================================
// Registra Middlewares
// ======================================
use KrothiumAPI\Http\Router;
use WorkbloomERP\Middleware\AuthMiddleware;
use WorkbloomERP\Module\Auth\Routes as AuthRoutes;
Router::defineMiddleware('auth', [AuthMiddleware::class, 'handle']);
// ======================================
// Importa rotas dos módulos
// ======================================
AuthRoutes::register();
// ============================
// Dispara o roteador