mirror of
https://github.com/bitwarden/browser
synced 2025-12-13 06:43:35 +00:00
Getting the WebVault url before returning the send on cli's remove password command (#7382)
This commit is contained in:
@@ -160,6 +160,7 @@ export class ServeCommand {
|
|||||||
this.sendRemovePasswordCommand = new SendRemovePasswordCommand(
|
this.sendRemovePasswordCommand = new SendRemovePasswordCommand(
|
||||||
this.main.sendService,
|
this.main.sendService,
|
||||||
this.main.sendApiService,
|
this.main.sendApiService,
|
||||||
|
this.main.environmentService,
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,4 @@
|
|||||||
|
import { EnvironmentService } from "@bitwarden/common/platform/abstractions/environment.service";
|
||||||
import { SendService } from "@bitwarden/common/tools/send/services//send.service.abstraction";
|
import { SendService } from "@bitwarden/common/tools/send/services//send.service.abstraction";
|
||||||
import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction";
|
import { SendApiService } from "@bitwarden/common/tools/send/services/send-api.service.abstraction";
|
||||||
|
|
||||||
@@ -8,6 +9,7 @@ export class SendRemovePasswordCommand {
|
|||||||
constructor(
|
constructor(
|
||||||
private sendService: SendService,
|
private sendService: SendService,
|
||||||
private sendApiService: SendApiService,
|
private sendApiService: SendApiService,
|
||||||
|
private environmentService: EnvironmentService,
|
||||||
) {}
|
) {}
|
||||||
|
|
||||||
async run(id: string) {
|
async run(id: string) {
|
||||||
@@ -16,7 +18,8 @@ export class SendRemovePasswordCommand {
|
|||||||
|
|
||||||
const updatedSend = await this.sendService.get(id);
|
const updatedSend = await this.sendService.get(id);
|
||||||
const decSend = await updatedSend.decrypt();
|
const decSend = await updatedSend.decrypt();
|
||||||
const res = new SendResponse(decSend);
|
const webVaultUrl = this.environmentService.getWebVaultUrl();
|
||||||
|
const res = new SendResponse(decSend, webVaultUrl);
|
||||||
return Response.success(res);
|
return Response.success(res);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
return Response.error(e);
|
return Response.error(e);
|
||||||
|
|||||||
@@ -297,7 +297,11 @@ export class SendProgram extends Program {
|
|||||||
})
|
})
|
||||||
.action(async (id: string) => {
|
.action(async (id: string) => {
|
||||||
await this.exitIfLocked();
|
await this.exitIfLocked();
|
||||||
const cmd = new SendRemovePasswordCommand(this.main.sendService, this.main.sendApiService);
|
const cmd = new SendRemovePasswordCommand(
|
||||||
|
this.main.sendService,
|
||||||
|
this.main.sendApiService,
|
||||||
|
this.main.environmentService,
|
||||||
|
);
|
||||||
const response = await cmd.run(id);
|
const response = await cmd.run(id);
|
||||||
this.processResponse(response);
|
this.processResponse(response);
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user