Skip to content

Commit

Permalink
fix: update user query in password update function (#631)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxmousse authored Jul 5, 2023
1 parent 04d6739 commit 1c500be
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libs/nestjs/password/src/services/password.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,9 @@ export class PasswordService {
oldPassword: string,
newPassword: string,
) {
const user = await this.userService.findUserById(userId);
// Password clause should be explicitly set to true, as we usually use a prisma
// middleware that remove the password field by default, if not explicitly set to true
const user = await this.userService.findUserById(userId, { passwordtrue});

if (!user) {
throw new UserNotFoundError();
Expand Down

0 comments on commit 1c500be

Please sign in to comment.