fix for establishing Send url in cloud vs on-prem (#1311)

This commit is contained in:
Matt Portune 2021-03-11 10:34:22 -05:00 committed by GitHub
parent 3c7029bdc8
commit 37bee011dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 2 deletions

View File

@ -182,7 +182,7 @@ namespace Bit.App.Utilities
return;
}
var platformUtilsService = ServiceContainer.Resolve<IPlatformUtilsService>("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<IEnvironmentService>("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<bool> RemoveSendPasswordAsync(string sendId)