emilsoftware-utilities 1.4.0-dev.5 → 1.4.0-dev.7

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.
@@ -43,11 +43,9 @@ let EmailService = class EmailService {
43
43
  var _a;
44
44
  try {
45
45
  const resetToken = (0, uuid_1.v4)(); // Generiamo un nuovo token unico
46
+ console.log("Generated reset token:", resetToken);
46
47
  // Aggiorna il campo keyReg nel database
47
- const result = yield Orm_1.Orm.query(this.accessiOptions.databaseOptions, "UPDATE UTENTI SET KEYREG = ?, STAREG = ? WHERE USRNAME = ? RETURNING CODUTE", [resetToken, StatoRegistrazione_1.StatoRegistrazione.INVIO, email]);
48
- if (result.length === 0) {
49
- throw new Error("Email non trovata.");
50
- }
48
+ const result = yield Orm_1.Orm.execute(this.accessiOptions.databaseOptions, "UPDATE UTENTI SET KEYREG = ?, STAREG = ? WHERE USRNAME = ? ", [resetToken, StatoRegistrazione_1.StatoRegistrazione.INVIO, email]);
51
49
  const returnUrlQueryParams = "?returnUrl=" + this.accessiOptions.confirmationEmailReturnUrl + "&prefix=" + ((_a = this.accessiOptions.confirmationEmailPrefix) !== null && _a !== void 0 ? _a : '');
52
50
  const { confirmationEmailUrl } = this.accessiOptions;
53
51
  let resetUrl = `${confirmationEmailUrl}/api/accessi/email/reset-password-page/${resetToken}${returnUrlQueryParams}`;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "emilsoftware-utilities",
3
- "version": "1.4.0-dev.5",
3
+ "version": "1.4.0-dev.7",
4
4
  "description": "Utilities for EmilSoftware",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",