Skip to content

Commit 44af478

Browse files
committed
fix: prevent username update to the same value in UserService
1 parent cad0637 commit 44af478

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

server/src/user/user.service.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,10 @@ export class UserService {
140140
);
141141
}
142142

143+
if (user.username === username) {
144+
throw new HttpException('Username is the same', HttpStatus.BAD_REQUEST);
145+
}
146+
143147
user.username = username;
144148

145149
return await user.save();

0 commit comments

Comments
 (0)