mirror of
https://github.com/bitwarden/browser
synced 2025-12-14 15:23:33 +00:00
[AC-1340] Fixed cipher restore for provider users by using the restore-admin endpoints (#5255)
This commit is contained in:
@@ -75,6 +75,6 @@ export abstract class CipherService {
|
||||
restore: (
|
||||
cipher: { id: string; revisionDate: string } | { id: string; revisionDate: string }[]
|
||||
) => Promise<any>;
|
||||
restoreWithServer: (id: string) => Promise<any>;
|
||||
restoreWithServer: (id: string, asAdmin?: boolean) => Promise<any>;
|
||||
restoreManyWithServer: (ids: string[]) => Promise<any>;
|
||||
}
|
||||
|
||||
@@ -914,8 +914,10 @@ export class CipherService implements CipherServiceAbstraction {
|
||||
await this.stateService.setEncryptedCiphers(ciphers);
|
||||
}
|
||||
|
||||
async restoreWithServer(id: string): Promise<any> {
|
||||
const response = await this.apiService.putRestoreCipher(id);
|
||||
async restoreWithServer(id: string, asAdmin = false): Promise<any> {
|
||||
const response = asAdmin
|
||||
? await this.apiService.putRestoreCipherAdmin(id)
|
||||
: await this.apiService.putRestoreCipher(id);
|
||||
await this.restore({ id: id, revisionDate: response.revisionDate });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user