1
0
mirror of https://github.com/bitwarden/browser synced 2026-02-08 20:50:28 +00:00

move sync to after checks

This commit is contained in:
rr-bw
2025-04-28 12:34:48 -07:00
parent 04272a2824
commit 7d2a364d16

View File

@@ -85,14 +85,8 @@ export class ChangePasswordComponent implements OnInit {
}
private async submitNew(passwordInputResult: PasswordInputResult) {
if (passwordInputResult.currentPassword == null) {
throw new Error("Invalid current password credential(s)");
}
try {
if (passwordInputResult.rotateUserKey) {
await this.syncService.fullSync(true);
if (this.activeAccount == null) {
throw new Error("activeAccount not found");
}
@@ -101,6 +95,8 @@ export class ChangePasswordComponent implements OnInit {
throw new Error("currentPassword not found");
}
await this.syncService.fullSync(true);
await this.changePasswordService.rotateUserKeyMasterPasswordAndEncryptedData(
passwordInputResult.currentPassword,
passwordInputResult.newPassword,
@@ -137,7 +133,7 @@ export class ChangePasswordComponent implements OnInit {
}
if (passwordInputResult.currentServerMasterKeyHash == null) {
throw new Error("Invalid current password credentials");
throw new Error("currentServerMasterKeyHash not found");
}
if (passwordInputResult.rotateUserKey) {