Skip to content

Commit

Permalink
refactor: revert back to delete user.password instead of setting va…
Browse files Browse the repository at this point in the history
…lue to undefined
  • Loading branch information
naftalimurgor committed Dec 9, 2023
1 parent 1b37355 commit f9bf7b2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions apps/api/src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ export class AuthService {
private readonly jwtService: JwtService,
private readonly mailerService: MailerService,
private readonly confirmCode: ConfirmCodeService
) { }
) {}

async register(
SignUpWithEmailCredentialsDto: Pure<SignUpWithEmailCredentialsDto>
): Promise<UserEntity> {
const user = await this.userService.create(SignUpWithEmailCredentialsDto)
user.password = undefined
delete user.password

//TODO: mock confirmCode
if (process.env.NODE_ENV !== 'test') {
Expand Down Expand Up @@ -73,7 +73,7 @@ export class AuthService {
`Wrong password for user with email: ${email}`
)
}
user.password = undefined
delete user.password

return user
}
Expand All @@ -88,7 +88,7 @@ export class AuthService {
`There isn't any user with email: ${payload.sub}`
)
}
user.password = undefined
delete user.password

return user
}
Expand Down

0 comments on commit f9bf7b2

Please sign in to comment.