cambios
This commit is contained in:
@@ -85,7 +85,7 @@ class CacheCredenciales {
|
||||
} catch (error) {
|
||||
console.error('Error al obtener del caché o desencriptar (posible corrupción):', error);
|
||||
// Si hay un error de desencriptación o parseo, el caché está corrupto; lo eliminamos.
|
||||
await this.eliminar().catch(() => {}); // Intentar eliminar, pero sin fallar si no se puede.
|
||||
await this.eliminar().catch(() => { }); // Intentar eliminar, pero sin fallar si no se puede.
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -367,7 +367,7 @@ function procesarCredenciales(credencialesRaw) {
|
||||
* @returns {Promise<object>} - Las credenciales procesadas y listas para usar.
|
||||
* @throws {Error} - Si no se pueden obtener las credenciales.
|
||||
*/
|
||||
export async function ObtenerCredenciales(solicitud, cacheSecretKey = process.env.CACHE_SECRET_KEY || 'a_secret_key_for_caching') {
|
||||
export async function ObtenerCredenciales(solicitud, cacheSecretKey = process.env.SECRET_CACHE_KEY || 'a_secret_key_for_caching') {
|
||||
const cacheName = crypto.createHash('md5').update(JSON.stringify(solicitud)).digest('hex');
|
||||
const cache = new CacheCredenciales(cacheName, cacheSecretKey);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user