From eb846f762748081ee97d39ab2b07dca5d5c1010d Mon Sep 17 00:00:00 2001 From: Oscar Hinton Date: Fri, 23 Jul 2021 10:22:59 +0200 Subject: [PATCH] [Provider] Resolve email not being url encoded (#1483) --- .../Services/Implementations/HandlebarsMailService.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/Core/Services/Implementations/HandlebarsMailService.cs b/src/Core/Services/Implementations/HandlebarsMailService.cs index c35f19836..e83d18062 100644 --- a/src/Core/Services/Implementations/HandlebarsMailService.cs +++ b/src/Core/Services/Implementations/HandlebarsMailService.cs @@ -660,8 +660,8 @@ namespace Bit.Core.Services WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash, SiteName = _globalSettings.SiteName, ProviderId = provider.Id.ToString(), - Email = email, - Token = token, + Email = WebUtility.UrlEncode(email), + Token = WebUtility.UrlEncode(token), }; await AddMessageContentAsync(message, "Provider.ProviderSetupInvite", model); message.Category = "ProviderSetupInvite"; @@ -674,11 +674,11 @@ namespace Bit.Core.Services var model = new ProviderUserInvitedViewModel { ProviderName = CoreHelpers.SanitizeForEmail(providerName), - Email = WebUtility.UrlDecode(providerUser.Email), + Email = WebUtility.UrlEncode(providerUser.Email), ProviderId = providerUser.ProviderId.ToString(), ProviderUserId = providerUser.Id.ToString(), ProviderNameUrlEncoded = WebUtility.UrlEncode(providerName), - Token = token, + Token = WebUtility.UrlEncode(token), WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash, SiteName = _globalSettings.SiteName, };