diff --git a/src/services/audit.service.ts b/src/services/audit.service.ts index 60553b834e..57279a09da 100644 --- a/src/services/audit.service.ts +++ b/src/services/audit.service.ts @@ -4,8 +4,7 @@ import { CryptoService } from '../abstractions/crypto.service'; const PwnedPasswordsApi = 'https://api.pwnedpasswords.com/range/'; export class AuditService implements AuditServiceAbstraction { - constructor(private cryptoService: CryptoService) { - } + constructor(private cryptoService: CryptoService) { } async passwordLeaked(password: string): Promise { const hash = (await this.cryptoService.sha1(password)).toUpperCase(); diff --git a/src/services/crypto.service.ts b/src/services/crypto.service.ts index 243afb66aa..b8db2f048e 100644 --- a/src/services/crypto.service.ts +++ b/src/services/crypto.service.ts @@ -454,7 +454,7 @@ export class CryptoService implements CryptoServiceAbstraction { async sha1(password: string): Promise { const passwordArr = UtilsService.fromUtf8ToArray(password); - const hash = await Crypto.subtle.digest({ name: 'SHA-1' }, passwordArr); + const hash = await Subtle.digest({ name: 'SHA-1' }, passwordArr); return UtilsService.fromBufferToHex(hash); }