Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/user/dto/update-user.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ export class UpdateUserDto {
@IsString()
@MinLength(3, { message: 'Username must be at least 3 characters long' })
@MaxLength(50, { message: 'Username must be at most 50 characters long' })
@Matches(/^[a-zA-Z](?!.*[_.]{2})[a-zA-Z0-9._]*[a-zA-Z0-9]$/, {
@Matches(/^[a-zA-Z](?!.*[_.-]{2})[a-zA-Z0-9._-]*[a-zA-Z0-9]$/, {
message:
'Username must start with a letter, end with a letter or number, and can only contain letters, numbers, dots, and underscores — without consecutive dots or underscores.',
'Username must start with a letter, end with a letter or number, and can only contain letters, numbers, dots, underscores, and hyphens — without consecutive dots, underscores, or hyphens.',
})
@Trim()
@ToLowerCase()
Expand Down
4 changes: 2 additions & 2 deletions src/user/dto/update-username.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ export class UpdateUsernameDto {
@IsNotEmpty({ message: 'Username is required' })
@MinLength(3, { message: 'Username must be at least 3 characters long' })
@MaxLength(50, { message: 'Username must be at most 50 characters long' })
@Matches(/^[a-zA-Z](?!.*[_.]{2})[a-zA-Z0-9._]+$/, {
@Matches(/^[a-zA-Z](?!.*[_.-]{2})[a-zA-Z0-9._-]+$/, {
message:
'Username must start with a letter and can only contain letters, numbers, dots, and underscores — without consecutive dots or underscores.',
'Username must start with a letter and can only contain letters, numbers, dots, underscores, and hyphens — without consecutive dots, underscores, or hyphens.',
})
@ApiProperty({
description: 'The new username for the user',
Expand Down