From 99924ca1449de3498882912697ff39ce888e969f Mon Sep 17 00:00:00 2001 From: "christian.julian" Date: Sun, 15 Jun 2025 15:28:18 -0600 Subject: [PATCH] fix --- api_candidatos/api/index.php | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/api_candidatos/api/index.php b/api_candidatos/api/index.php index 62148d0..b6f0097 100644 --- a/api_candidatos/api/index.php +++ b/api_candidatos/api/index.php @@ -19,21 +19,18 @@ $method = $_SERVER['REQUEST_METHOD']; $basePath = '/api_candidatos'; $normalizedPath = str_replace($basePath, '', $path); -// Enrutamiento switch (true) { case preg_match('#^/oauth/token#', $normalizedPath): - require_once __DIR__ . '/../src/Oauth/Routes/AuthRoutes.php'; - // /../src/candidatos/index.php + echo json_encode(["mensaje" => "Entró en oauth/token"]); + // require_once __DIR__ . '/../src/Oauth/Routes/AuthRoutes.php'; break; case preg_match('#^/candidatos#', $normalizedPath): - // Verificar token de OAuth 2.0 antes de acceder a rutas protegidas - require_once __DIR__ . '/../src/Oauth/Middleware/AuthMiddleware.php'; - - // Solo continuamos si el token es válido - if (\OAuth\Middleware\AuthMiddleware::verifyToken()) { - require_once __DIR__ . '/../src/candidatos/index.php'; - } + echo json_encode(["mensaje" => "Entró en candidatos"]); + // require_once __DIR__ . '/../src/Oauth/Middleware/AuthMiddleware.php'; + // if (\OAuth\Middleware\AuthMiddleware::verifyToken()) { + // require_once __DIR__ . '/../src/candidatos/index.php'; + // } break; default: @@ -41,4 +38,5 @@ switch (true) { echo json_encode(["error" => "Ruta no encontrada"]); break; } + ?> \ No newline at end of file