mirror of
https://github.com/bitwarden/browser
synced 2025-12-16 16:23:44 +00:00
fix init account validation (#9034)
This commit is contained in:
@@ -771,16 +771,10 @@ export class CryptoService implements CryptoServiceAbstraction {
|
|||||||
publicKey: string;
|
publicKey: string;
|
||||||
privateKey: EncString;
|
privateKey: EncString;
|
||||||
}> {
|
}> {
|
||||||
// Verify keys don't exist
|
// Verify user key doesn't exist
|
||||||
const existingUserKey = await this.getUserKey();
|
const existingUserKey = await this.getUserKey();
|
||||||
const existingPrivateKey = await this.getPrivateKey();
|
if (existingUserKey != null) {
|
||||||
if (existingUserKey != null || existingPrivateKey != null) {
|
this.logService.error("Tried to initialize account with existing user key.");
|
||||||
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.");
|
|
||||||
}
|
|
||||||
throw new Error("Cannot initialize account, keys already exist.");
|
throw new Error("Cannot initialize account, keys already exist.");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user