AnhLedger commited on
Commit
135c51d
·
1 Parent(s): 17cd84b

feature: Set min length for password

Browse files
backend/src/modules/authentication/dto/sign-in.dto.ts CHANGED
@@ -1,9 +1,10 @@
1
- import { IsString } from 'class-validator';
2
 
3
  export class SignInDto {
4
  @IsString()
5
  username: string;
6
 
7
  @IsString()
 
8
  password: string;
9
  }
 
1
+ import { IsString, MinLength } from 'class-validator';
2
 
3
  export class SignInDto {
4
  @IsString()
5
  username: string;
6
 
7
  @IsString()
8
+ @MinLength(8)
9
  password: string;
10
  }
backend/src/modules/authentication/dto/sign-up.dto.ts CHANGED
@@ -1,10 +1,17 @@
1
- import { IsString, IsEmail, IsMobilePhone, IsOptional, IsNumber, IsDate, isBoolean } from "class-validator";
 
 
 
 
 
 
 
2
 
3
  export class SignUpDto{
4
  @IsString()
5
  full_name: string;
6
 
7
- @IsString()
8
  phone_number: string;
9
 
10
  @IsOptional()
@@ -12,5 +19,6 @@ export class SignUpDto{
12
  email?: string;
13
 
14
  @IsString()
 
15
  password: string;
16
  }
 
1
+ import {
2
+ IsString,
3
+ IsEmail,
4
+ IsMobilePhone,
5
+ IsOptional,
6
+ IsNumber,
7
+ MinLength
8
+ } from "class-validator";
9
 
10
  export class SignUpDto{
11
  @IsString()
12
  full_name: string;
13
 
14
+ @IsMobilePhone('vi-VN')
15
  phone_number: string;
16
 
17
  @IsOptional()
 
19
  email?: string;
20
 
21
  @IsString()
22
+ @MinLength(8)
23
  password: string;
24
  }