@jmlq/auth 0.0.1-alpha.35 → 0.0.1-alpha.36

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.
@@ -2,5 +2,6 @@ import { UserRole } from "../types";
2
2
  export interface RegisterUserRequest {
3
3
  email: string;
4
4
  password: string;
5
+ confirmPassword: string;
5
6
  roles: UserRole[];
6
7
  }
@@ -36,6 +36,9 @@ class RegisterUserUseCase {
36
36
  // Use case
37
37
  // ---------------------------------------------------------------------------
38
38
  async execute(request) {
39
+ // Validar que el password y su confirmación sean iguales
40
+ if (request.password != request.confirmPassword)
41
+ throw new domain_1.PasswordMismatchError();
39
42
  // Validar policy antes de hacer trabajo costoso (hash)
40
43
  (0, internal_1.assertPasswordPolicy)(this.passwordPolicy, request.password);
41
44
  // Verificar que el email no esté en uso
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@jmlq/auth",
3
3
  "description": "JWT authentication package with clean architecture",
4
- "version": "0.0.1-alpha.35",
4
+ "version": "0.0.1-alpha.36",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "scripts": {