backend-plus 2.5.2-betha.28 → 2.5.2-betha.30

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.
Files changed (2) hide show
  1. package/lib/backend-plus.js +9 -17
  2. package/package.json +14 -14
@@ -98,7 +98,7 @@ const bufferToBase64 = (buffer) => buffer.toString('base64');
98
98
  * Función central para PBKDF2 (Acepta KEY_LEN para compatibilidad).
99
99
  * Devuelve la clave derivada con la longitud especificada.
100
100
  */
101
- function deriveKey(password, saltBuffer, iterations, keyLength) {
101
+ async function deriveKey(password, saltBuffer, iterations, keyLength) {
102
102
  return new Promise((resolve, reject) => {
103
103
  crypto.pbkdf2(
104
104
  password,
@@ -1175,9 +1175,7 @@ AppBackend.prototype.start = function start(opts){
1175
1175
  }
1176
1176
  });
1177
1177
  const updatePassword = async ({client, username, password, setUpdateDate, errorIfNoResult}) => {
1178
- const {table, passFieldName, userFieldName, passUpdatedAtFieldName, passAlgorithmFieldName} = be.config.login;
1179
- const { schema } = be.config.db;
1180
-
1178
+ const {table, passFieldName, userFieldName, passUpdatedAtFieldName, passAlgorithmFieldName, schema} = be.config.login;
1181
1179
  const hashPass = await generateScramVerifier(password);
1182
1180
  let params = [username, hashPass];
1183
1181
  let setters = [`${be.db.quoteIdent(passFieldName)} = $2`];
@@ -1308,23 +1306,22 @@ AppBackend.prototype.start = function start(opts){
1308
1306
  userInfo.bitacoraId = sessionInfo.value;
1309
1307
  }
1310
1308
  done(null, userInfo);
1311
- client.done();
1312
1309
  }catch(err){
1313
1310
  if(be.config.login["double-dragon"]){
1314
1311
  done(null,false,{message:be.messages.unlogged.login.userOrPassFail});
1315
1312
  }
1316
- if(client && typeof client.done === "function"){
1317
- client.done();
1318
- }
1319
1313
  console.log('login error',err);
1320
1314
  console.log(err.stack);
1321
1315
  done(new Error('internal login error'));
1322
- };
1316
+ } finally {
1317
+ if(client && typeof client.done === "function"){
1318
+ client.done();
1319
+ }
1320
+ }
1323
1321
  }
1324
1322
  );
1325
1323
  be.changePassword=async function(client,username,oldPassword,newPassword){
1326
- const { table, passFieldName, userFieldName } = be.config.login;
1327
- const { schema } = be.config.db;
1324
+ const { table, passFieldName, userFieldName, schema } = be.config.login;
1328
1325
  let ok = false;
1329
1326
  const data = await client.query(
1330
1327
  `SELECT *
@@ -1371,16 +1368,11 @@ AppBackend.prototype.start = function start(opts){
1371
1368
  if(be.config.login.disableChangePassword){
1372
1369
  done(null,false,'el cambio de contraseña está deshabilitado');
1373
1370
  }else{
1374
- var client;
1375
- be.inTransaction(req,function(cli){
1376
- client = cli;
1371
+ be.inTransaction(req,function(client){
1377
1372
  return be.changePassword(client,username,oldPassword,newPassword)
1378
1373
  }).then(function(ok){
1379
1374
  done(null,ok,ok?null:be.messages.server.oldPassDontMatch);
1380
1375
  }).catch(function(err){
1381
- //if(client && client.done){
1382
- // client.done();
1383
- //}
1384
1376
  console.log('error changing pass',err);
1385
1377
  console.log('stack',err.stack);
1386
1378
  throw err;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "backend-plus",
3
3
  "description": "Backend for the anti Pareto rule",
4
- "version": "2.5.2-betha.28",
4
+ "version": "2.5.2-betha.30",
5
5
  "author": "Codenautas <codenautas@googlegroups.com>",
6
6
  "license": "MIT",
7
7
  "repository": "codenautas/backend-plus",
@@ -32,7 +32,7 @@
32
32
  "@upgraded/locate-path": "^6.0.0-alfa.1",
33
33
  "ajax-best-promise": "^0.4.2",
34
34
  "backend-skins": "^0.1.15",
35
- "best-globals": "^2.0.1",
35
+ "best-globals": "^2.0.2",
36
36
  "big.js": "^7.0.1",
37
37
  "body-parser": "^2.2.0",
38
38
  "cast-error": "^0.1.2",
@@ -44,10 +44,10 @@
44
44
  "discrepances": "^0.2.9",
45
45
  "express": "^5.1.0",
46
46
  "express-session": "^1.18.2",
47
- "express-useragent": "^1.0.15",
48
- "fs-extra": "^11.3.1",
47
+ "express-useragent": "^2.0.2",
48
+ "fs-extra": "^11.3.2",
49
49
  "js-to-html": "^1.3.2",
50
- "js-yaml": "^4.1.0",
50
+ "js-yaml": "^4.1.1",
51
51
  "json4all": "^1.4.0",
52
52
  "lazy-some": "^0.1.0",
53
53
  "like-ar": "^0.5.1",
@@ -56,7 +56,7 @@
56
56
  "mini-tools": "^1.13.4",
57
57
  "moment": "^2.30.1",
58
58
  "multiparty": "^4.2.3",
59
- "nodemailer": "^7.0.6",
59
+ "nodemailer": "^7.0.10",
60
60
  "numeral": "^2.0.6",
61
61
  "pg-promise-strict": "^1.4.3",
62
62
  "pg-triggers": "0.4.3",
@@ -68,7 +68,7 @@
68
68
  "self-explain": "^0.11.0",
69
69
  "serve-content": "^1.0.2",
70
70
  "session-file-store": "^1.5.0",
71
- "simple-git": "^3.28.0",
71
+ "simple-git": "^3.30.0",
72
72
  "sql-tools": "^0.1.2",
73
73
  "stack-trace": "^0.0.10",
74
74
  "stylus": "0.64.0",
@@ -79,16 +79,16 @@
79
79
  "devDependencies": {
80
80
  "@types/big.js": "^6.2.2",
81
81
  "@types/expect.js": "~0.3.32",
82
- "@types/express": "^5.0.3",
82
+ "@types/express": "^5.0.5",
83
83
  "@types/express-useragent": "^1.0.5",
84
84
  "@types/fs-extra": "^11.0.4",
85
85
  "@types/js-yaml": "^4.0.9",
86
86
  "@types/mocha": "^10.0.10",
87
87
  "@types/multiparty": "~4.2.1",
88
- "@types/node": "^24.4.0",
89
- "@types/nodemailer": "^7.0.1",
88
+ "@types/node": "^24.10.1",
89
+ "@types/nodemailer": "^7.0.4",
90
90
  "@types/numeral": "~2.0.5",
91
- "@types/session-file-store": "^1.2.5",
91
+ "@types/session-file-store": "^1.2.6",
92
92
  "@types/stack-trace": "~0.0.33",
93
93
  "@types/websql": "~0.0.30",
94
94
  "esprima": "^4.0.1",
@@ -100,13 +100,13 @@
100
100
  "karma-ie-launcher": "^1.0.0",
101
101
  "karma-mocha": "^2.0.1",
102
102
  "kill-9": "~0.4.3",
103
- "mocha": "^11.7.2",
103
+ "mocha": "^11.7.5",
104
104
  "nyc": "^17.1.0",
105
- "puppeteer": "^24.20.0",
105
+ "puppeteer": "^24.31.0",
106
106
  "sinon": "^21.0.0",
107
107
  "supertest": "^7.1.4",
108
108
  "types.d.ts": "~0.6.22",
109
- "typescript": "^5.9.2",
109
+ "typescript": "^5.9.3",
110
110
  "why-is-node-running": "^3.2.2"
111
111
  },
112
112
  "engines": {