1
0
mirror of https://github.com/bitwarden/cli synced 2025-12-06 04:23:19 +00:00

Use send.bitwarden.com (#251)

* Use send.bitwarden.com

still need compatibiltiy with /#/send/id/key, but adding on
compability with #id/key

* Fix create links pointing to vault with wrong hash

* Fix Url
This commit is contained in:
Matt Gibson
2021-03-11 10:39:31 -06:00
committed by GitHub
parent b80c93012b
commit 976be0fe67
3 changed files with 10 additions and 4 deletions

2
jslib

Submodule jslib updated: 8541027d40...f80e89465f

View File

@@ -94,7 +94,7 @@ export class SendReceiveCommand extends DownloadCommand {
}
private getIdAndKey(url: URL): [string, string] {
const result = url.hash.split('/').slice(2);
const result = url.hash.slice(1).split('/').slice(-2);
return [result[0], result[1]];
}

View File

@@ -63,7 +63,7 @@ export class SendResponse implements BaseResponse {
private static getStandardDeletionDate(days: number) {
const d = new Date();
d.setTime(d.getTime() + (days * 86400000)) // ms per day
d.setTime(d.getTime() + (days * 86400000)); // ms per day
return d;
}
@@ -92,7 +92,13 @@ export class SendResponse implements BaseResponse {
}
this.id = o.id;
this.accessId = o.accessId;
this.accessUrl = (webVaultUrl ?? 'https://vault.bitwarden.com') + '/#/send/' + this.accessId + '/' + o.urlB64Key;
let sendLinkBaseUrl = webVaultUrl;
if (sendLinkBaseUrl == null) {
sendLinkBaseUrl = 'https://send.bitwarden.com/#';
} else {
sendLinkBaseUrl += '/#/send/';
}
this.accessUrl = sendLinkBaseUrl + this.accessId + '/' + o.urlB64Key;
this.name = o.name;
this.notes = o.notes;
this.key = Utils.fromBufferToB64(o.key);