diff --git a/jslib b/jslib index 8541027d40..f80e89465f 160000 --- a/jslib +++ b/jslib @@ -1 +1 @@ -Subproject commit 8541027d402939bb106bc0b3ae238caf29dfd641 +Subproject commit f80e89465ffc004705d2941301c0ffb6bfd71d1a diff --git a/src/commands/send/receive.command.ts b/src/commands/send/receive.command.ts index 819edee5e3..10e0d140d0 100644 --- a/src/commands/send/receive.command.ts +++ b/src/commands/send/receive.command.ts @@ -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]]; } diff --git a/src/models/response/sendResponse.ts b/src/models/response/sendResponse.ts index 4c073dd18a..da2d536ae1 100644 --- a/src/models/response/sendResponse.ts +++ b/src/models/response/sendResponse.ts @@ -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);