From 4c860e12d7c3189ba132b74b9d807ef07214dde6 Mon Sep 17 00:00:00 2001 From: Jake Fink Date: Fri, 3 May 2024 12:23:12 -0400 Subject: [PATCH] fix init account validation (#9034) --- libs/common/src/platform/services/crypto.service.ts | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/libs/common/src/platform/services/crypto.service.ts b/libs/common/src/platform/services/crypto.service.ts index 6a5ae71529f..b90fab6b491 100644 --- a/libs/common/src/platform/services/crypto.service.ts +++ b/libs/common/src/platform/services/crypto.service.ts @@ -771,16 +771,10 @@ export class CryptoService implements CryptoServiceAbstraction { publicKey: string; privateKey: EncString; }> { - // Verify keys don't exist + // Verify user key doesn't exist const existingUserKey = await this.getUserKey(); - const existingPrivateKey = await this.getPrivateKey(); - if (existingUserKey != null || existingPrivateKey != null) { - if (existingUserKey != null) { - this.logService.error("Tried to initialize account with existing user key."); - } - if (existingPrivateKey != null) { - this.logService.error("Tried to initialize account with existing private key."); - } + if (existingUserKey != null) { + this.logService.error("Tried to initialize account with existing user key."); throw new Error("Cannot initialize account, keys already exist."); }