fpavon-ee-shared 1.0.16 → 1.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -44,7 +44,7 @@ const validarToken = (req, res, next) => __awaiter(void 0, void 0, void 0, funct
|
|
|
44
44
|
// Limpio el token de comillas por las dudas
|
|
45
45
|
token = token.replace(/['"]+/g, '');
|
|
46
46
|
const secret = getSecret();
|
|
47
|
-
console.
|
|
47
|
+
console.error("SECRET: validarToken ", secret);
|
|
48
48
|
let data = jsonwebtoken_1.default.verify(token, (secret || ''));
|
|
49
49
|
const { afiliado, idNavegador } = data;
|
|
50
50
|
// Verificar si el usuario está deslogueado
|
|
@@ -129,7 +129,7 @@ exports.extraerNivel = extraerNivel;
|
|
|
129
129
|
//Para generar token que se usará en el front end
|
|
130
130
|
const cifrado = (usuario) => {
|
|
131
131
|
const secreto = getSecret();
|
|
132
|
-
console.
|
|
132
|
+
console.error("SECRET: cifrado ", secreto);
|
|
133
133
|
return new Promise((resolve, reject) => {
|
|
134
134
|
jsonwebtoken_1.default.sign(usuario, secreto, { expiresIn: '12h' }, (err, token) => {
|
|
135
135
|
return err ? reject("no se pudo generar el JWT") : resolve(token);
|
|
@@ -37,7 +37,7 @@ const validarToken = async (req: Request, res: Response, next: NextFunction): Pr
|
|
|
37
37
|
// Limpio el token de comillas por las dudas
|
|
38
38
|
token = token.replace(/['"]+/g, '');
|
|
39
39
|
const secret = getSecret();
|
|
40
|
-
console.
|
|
40
|
+
console.error("SECRET: validarToken ", secret)
|
|
41
41
|
let data: any = jwt.verify(token, (secret || ''));
|
|
42
42
|
const { afiliado, idNavegador } = data;
|
|
43
43
|
|
|
@@ -140,7 +140,7 @@ export const cifrado = (usuario:any)=>{
|
|
|
140
140
|
|
|
141
141
|
|
|
142
142
|
const secreto:any= getSecret();
|
|
143
|
-
console.
|
|
143
|
+
console.error("SECRET: cifrado ", secreto)
|
|
144
144
|
|
|
145
145
|
return new Promise((resolve:any,reject:any)=>{
|
|
146
146
|
|