mirror of
https://github.com/docmost/docmost.git
synced 2025-11-25 03:11:10 +10:00
fix: refactor forgot password system (#329)
* refactor forgot password system * ready
This commit is contained in:
@ -1,16 +1,7 @@
|
||||
import { IsEmail, IsNotEmpty, IsOptional, IsString, MinLength } from 'class-validator';
|
||||
import { IsEmail, IsNotEmpty } from 'class-validator';
|
||||
|
||||
export class ForgotPasswordDto {
|
||||
@IsNotEmpty()
|
||||
@IsEmail()
|
||||
email: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
token: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MinLength(8)
|
||||
newPassword: string;
|
||||
}
|
||||
|
||||
10
apps/server/src/core/auth/dto/password-reset.dto.ts
Normal file
10
apps/server/src/core/auth/dto/password-reset.dto.ts
Normal file
@ -0,0 +1,10 @@
|
||||
import { IsString, MinLength } from 'class-validator';
|
||||
|
||||
export class PasswordResetDto {
|
||||
@IsString()
|
||||
token: string;
|
||||
|
||||
@IsString()
|
||||
@MinLength(8)
|
||||
newPassword: string;
|
||||
}
|
||||
9
apps/server/src/core/auth/dto/verify-user-token.dto.ts
Normal file
9
apps/server/src/core/auth/dto/verify-user-token.dto.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { IsString, MinLength } from 'class-validator';
|
||||
|
||||
export class VerifyUserTokenDto {
|
||||
@IsString()
|
||||
token: string;
|
||||
|
||||
@IsString()
|
||||
type: string;
|
||||
}
|
||||
Reference in New Issue
Block a user