From 37bee011dc5d07bc3fc07517f65a2792a1284c83 Mon Sep 17 00:00:00 2001 From: Matt Portune <59324545+mportune-bw@users.noreply.github.com> Date: Thu, 11 Mar 2021 10:34:22 -0500 Subject: [PATCH] fix for establishing Send url in cloud vs on-prem (#1311) --- src/App/Utilities/AppHelpers.cs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/App/Utilities/AppHelpers.cs b/src/App/Utilities/AppHelpers.cs index df5683544..73b1e1f1f 100644 --- a/src/App/Utilities/AppHelpers.cs +++ b/src/App/Utilities/AppHelpers.cs @@ -182,7 +182,7 @@ namespace Bit.App.Utilities return; } var platformUtilsService = ServiceContainer.Resolve("platformUtilsService"); - await platformUtilsService.CopyToClipboardAsync(AppHelpers.GetSendUrl(send)); + await platformUtilsService.CopyToClipboardAsync(GetSendUrl(send)); platformUtilsService.ShowToast("info", null, string.Format(AppResources.ValueHasBeenCopied, AppResources.SendLink)); } @@ -204,7 +204,12 @@ namespace Bit.App.Utilities private static string GetSendUrl(SendView send) { var environmentService = ServiceContainer.Resolve("environmentService"); - return environmentService.BaseUrl + "/#/send/" + send.AccessId + "/" + send.UrlB64Key; + var webVaultUrl = environmentService.GetWebVaultUrl(); + if (webVaultUrl != null) + { + return webVaultUrl + "/#/send/" + send.AccessId + "/" + send.UrlB64Key; + } + return "https://send.bitwarden.com/#" + send.AccessId + "/" + send.UrlB64Key; } public static async Task RemoveSendPasswordAsync(string sendId)