From 1ec21741cc3b729cea5a804c322c138dad8c5fda Mon Sep 17 00:00:00 2001 From: dmolinari Date: Thu, 26 Jun 2025 21:46:57 -0300 Subject: [PATCH] Retry Secret JWT Key --- .gitea/workflows/deploy.yml | 1 + Backend/GestionIntegral.Api/Program.cs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index 7533a47..32c6123 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -58,6 +58,7 @@ jobs: # 3. Despliegue con Docker Compose cd /opt/gestion-integral export DB_SA_PASSWORD='${{ secrets.DB_SA_PASSWORD_SECRET }}' + export JWT_KEY=${{ secrets.JWT_KEY }}' echo "Recreando servicios..." docker compose up -d --force-recreate diff --git a/Backend/GestionIntegral.Api/Program.cs b/Backend/GestionIntegral.Api/Program.cs index 80175c0..30fe4a8 100644 --- a/Backend/GestionIntegral.Api/Program.cs +++ b/Backend/GestionIntegral.Api/Program.cs @@ -114,7 +114,7 @@ var jwtSettings = builder.Configuration.GetSection("Jwt"); // Le decimos que busque la clave JWT en la raíz de la configuración (donde están las variables de entorno). // Si no la encuentra, como respaldo, busca en la sección "Jwt" del appsettings. -var jwtKey = builder.Configuration["JWT_KEY"] ?? jwtSettings["Key"] ?? throw new ArgumentNullException("JWT_KEY or Jwt:Key not configured"); +var jwtKey = builder.Configuration["JWT_KEY"] ?? /*jwtSettings["Key"] ??*/ throw new ArgumentNullException("JWT_KEY or Jwt:Key not configured"); var keyBytes = Encoding.ASCII.GetBytes(jwtKey);