@maestro-js/password 1.0.0-alpha.18 → 1.0.0-alpha.19

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.
package/dist/index.d.ts CHANGED
@@ -44,7 +44,6 @@ declare namespace Password {
44
44
  expirationMinutes: number;
45
45
  }) => Promise<string>;
46
46
  resetPassword: (options: {
47
- authenticatableId: Id;
48
47
  token: string;
49
48
  newPassword: string;
50
49
  }) => Promise<void>;
package/dist/index.js CHANGED
@@ -49,11 +49,7 @@ function create(config) {
49
49
  });
50
50
  return `${selector}|${verifier}`;
51
51
  }
52
- async function resetPassword({
53
- authenticatableId,
54
- token,
55
- newPassword
56
- }) {
52
+ async function resetPassword({ token, newPassword }) {
57
53
  if (!passwordResetOptions) {
58
54
  throw new Error("Password reset is not configured. Provide `passwordResetOptions` when creating the password service.");
59
55
  }
@@ -72,13 +68,10 @@ function create(config) {
72
68
  if (record.expirationDate < instantFns.now()) {
73
69
  throw new PasswordResetExpiredTokenError();
74
70
  }
75
- if (record.authenticatableId !== authenticatableId) {
76
- throw new PasswordResetInvalidTokenError();
77
- }
78
71
  const passwordHash = await config.hash.hash(newPassword);
79
- await config.updatePasswordHash(authenticatableId, passwordHash);
80
- await config.updateCredentialsInvalidBefore(authenticatableId, instantFns.now());
81
- await passwordResetOptions.deleteByAuthenticatableId(authenticatableId);
72
+ await config.updatePasswordHash(record.authenticatableId, passwordHash);
73
+ await config.updateCredentialsInvalidBefore(record.authenticatableId, instantFns.now());
74
+ await passwordResetOptions.deleteByAuthenticatableId(record.authenticatableId);
82
75
  }
83
76
  return {
84
77
  verifyCredentials,
package/package.json CHANGED
@@ -7,7 +7,7 @@
7
7
  "default": "./dist/index.js"
8
8
  }
9
9
  },
10
- "version": "1.0.0-alpha.18",
10
+ "version": "1.0.0-alpha.19",
11
11
  "publishConfig": {
12
12
  "access": "restricted"
13
13
  },
@@ -16,15 +16,15 @@
16
16
  ],
17
17
  "dependencies": {
18
18
  "iso-fns2": "npm:iso-fns@2.0.0-alpha.26",
19
- "@maestro-js/service-registry": "1.0.0-alpha.18",
20
- "@maestro-js/custom-errors": "1.0.0-alpha.18"
19
+ "@maestro-js/custom-errors": "1.0.0-alpha.19",
20
+ "@maestro-js/service-registry": "1.0.0-alpha.19"
21
21
  },
22
22
  "peerDependencies": {
23
- "@maestro-js/hash": "1.0.0-alpha.18"
23
+ "@maestro-js/hash": "1.0.0-alpha.19"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^22.19.11",
27
- "@maestro-js/hash": "1.0.0-alpha.18"
27
+ "@maestro-js/hash": "1.0.0-alpha.19"
28
28
  },
29
29
  "license": "UNLICENSED",
30
30
  "engines": {