Retry 2239
	
		
			
	
		
	
	
		
	
		
			Some checks failed
		
		
	
	
		
			
				
	
				Optimized Build and Deploy / remote-build-and-deploy (push) Failing after 1m40s
				
			
		
		
	
	
				
					
				
			
		
			Some checks failed
		
		
	
	Optimized Build and Deploy / remote-build-and-deploy (push) Failing after 1m40s
				
			This commit is contained in:
		| @@ -112,9 +112,18 @@ builder.Services.AddHealthChecks() | ||||
| // --- Configuración de Autenticación JWT --- | ||||
| var jwtSettings = builder.Configuration.GetSection("Jwt"); | ||||
|  | ||||
| // Lee la RUTA al archivo del secreto desde la variable de entorno | ||||
| var jwtKeyFilePath = builder.Configuration["JWT_KEY_FILE"];  | ||||
|  | ||||
| // Si la ruta existe (estamos en Docker Swarm), lee el contenido del archivo. | ||||
| // Si no, vuelve a buscar la variable de entorno (para desarrollo local). | ||||
| var jwtKey = !string.IsNullOrEmpty(jwtKeyFilePath) && File.Exists(jwtKeyFilePath) | ||||
|     ? File.ReadAllText(jwtKeyFilePath).Trim() | ||||
|     : builder.Configuration["JWT_KEY"] ?? throw new ArgumentNullException("JWT Key not configured"); | ||||
|  | ||||
| // 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); | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user