-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Correção parra passagem dos testes em CI
- Loading branch information
Showing
3 changed files
with
22 additions
and
25 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,20 @@ | ||
import { IsNotEmpty, IsString, Length, Matches } from 'class-validator'; | ||
|
||
export class ChangePasswordDto { | ||
static currentPassword(currentPassword: any, password: string): any { | ||
throw new Error('Method not implemented.'); | ||
} | ||
@IsNotEmpty() | ||
@IsString() | ||
currentPassword: string; | ||
public currentPassword: string; | ||
|
||
@IsNotEmpty() | ||
@IsString() | ||
@Length(8, 128, { message: 'A nova senha deve ter entre 8 e 128 caracteres.' }) | ||
@Matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[!@#$%^&*(),.?":{}|<>])[A-Za-z\d!@#$%^&*(),.?":{}|<>]+$/, { | ||
message: | ||
'A nova senha deve conter pelo menos uma letra minúscula, uma letra maiúscula, um número e um caractere especial.', | ||
}) | ||
public newPassword: string; | ||
|
||
@IsNotEmpty() | ||
@IsString() | ||
newPassword: string; | ||
constructor(currentPassword: string, newPassword: string) { | ||
this.currentPassword = currentPassword; | ||
this.newPassword = newPassword; | ||
} | ||
} |