mirror of
https://github.com/docmost/docmost.git
synced 2025-11-25 03:11:10 +10:00
feat(backend): forgot password (#250)
* feat(backend): forgot password * feat: apply feedback from code review * chore(auth): validate the minimum length of 'newPassword' * chore(auth): make token has an expiry of 1 hour * chore: rename all occurrences of 'code' to 'token' * chore(backend): provide value on nanoIdGen method
This commit is contained in:
16
apps/server/src/core/auth/dto/forgot-password.dto.ts
Normal file
16
apps/server/src/core/auth/dto/forgot-password.dto.ts
Normal file
@ -0,0 +1,16 @@
|
||||
import { IsEmail, IsNotEmpty, IsOptional, IsString, MinLength } from 'class-validator';
|
||||
|
||||
export class ForgotPasswordDto {
|
||||
@IsNotEmpty()
|
||||
@IsEmail()
|
||||
email: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
token: string;
|
||||
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
@MinLength(8)
|
||||
newPassword: string;
|
||||
}
|
||||
Reference in New Issue
Block a user