From 10a4b3c0611e64399180c24b6bd272940a5a6482 Mon Sep 17 00:00:00 2001 From: Anand Chowdhary Date: Fri, 30 Oct 2020 17:38:28 +0530 Subject: [PATCH] :bug: Fix password hash in Pwned --- src/modules/approved-subnets/approved-subnets.service.ts | 1 - src/modules/auth/auth.service.ts | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/modules/approved-subnets/approved-subnets.service.ts b/src/modules/approved-subnets/approved-subnets.service.ts index 688c98857..1b6a46ba3 100644 --- a/src/modules/approved-subnets/approved-subnets.service.ts +++ b/src/modules/approved-subnets/approved-subnets.service.ts @@ -93,7 +93,6 @@ export class ApprovedSubnetsService { region: location?.subdivisions.pop()?.names?.en, timezone: location?.location?.time_zone, countryCode: location?.country?.iso_code, - createdAt: new Date(), }, }); return this.prisma.expose(approved); diff --git a/src/modules/auth/auth.service.ts b/src/modules/auth/auth.service.ts index cd082b0ea..62280f774 100644 --- a/src/modules/auth/auth.service.ts +++ b/src/modules/auth/auth.service.ts @@ -558,7 +558,10 @@ export class AuthService { ): Promise { if (!ignorePwnedPassword) { if (!this.configService.get('security.passwordPwnedCheck')) - return; + return await hash( + password, + this.configService.get('security.saltRounds'), + ); if (!(await this.pwnedService.isPasswordSafe(password))) throw new HttpException( 'This password has been compromised in a data breach.',