mirror of
https://github.com/bitwarden/server.git
synced 2024-11-25 12:45:18 +01:00
vault with hash
This commit is contained in:
parent
d2c5fb462c
commit
297b0253e4
@ -28,6 +28,7 @@ namespace Bit.Core
|
||||
public class BaseServiceUriSettings
|
||||
{
|
||||
public string Vault { get; set; }
|
||||
public string VaultWithHash => $"{Vault}/#";
|
||||
public string Api { get; set; }
|
||||
public string Identity { get; set; }
|
||||
public string InternalIdentity { get; set; }
|
||||
|
@ -26,7 +26,7 @@ Desktop
|
||||
Web
|
||||
============
|
||||
|
||||
You can also access your vault from any web-enabled device using our web vault at: <{{vaultUrl}}>
|
||||
You can also access your vault from any web-enabled device using our web vault at: <{{vaultUrl}}?utm_source=welcome_email&utm_medium=email>
|
||||
|
||||
------------
|
||||
|
||||
|
@ -29,7 +29,7 @@ namespace Bit.Core.Services
|
||||
var model = new Dictionary<string, string>
|
||||
{
|
||||
["url"] = string.Format("{0}/verify-email?userId={1}&token={2}",
|
||||
_globalSettings.BaseServiceUri.Vault, userId, WebUtility.UrlEncode(token))
|
||||
_globalSettings.BaseServiceUri.VaultWithHash, userId, WebUtility.UrlEncode(token))
|
||||
};
|
||||
|
||||
var message = await CreateMessageAsync("Verify Your Email", email, "VerifyEmail", model);
|
||||
@ -42,7 +42,7 @@ namespace Bit.Core.Services
|
||||
var model = new Dictionary<string, string>
|
||||
{
|
||||
["url"] = string.Format("{0}/verify-recover-delete?userId={1}&token={2}&email={3}",
|
||||
_globalSettings.BaseServiceUri.Vault,
|
||||
_globalSettings.BaseServiceUri.VaultWithHash,
|
||||
userId,
|
||||
WebUtility.UrlEncode(token),
|
||||
WebUtility.UrlEncode(email)),
|
||||
@ -96,7 +96,7 @@ namespace Bit.Core.Services
|
||||
var model = new Dictionary<string, string>
|
||||
{
|
||||
["hint"] = WebUtility.HtmlEncode(hint),
|
||||
["vaultUrl"] = _globalSettings.BaseServiceUri.Vault
|
||||
["vaultUrl"] = _globalSettings.BaseServiceUri.VaultWithHash
|
||||
};
|
||||
|
||||
var message = await CreateMessageAsync("Your Master Password Hint", email, "MasterPasswordHint", model);
|
||||
@ -146,7 +146,7 @@ namespace Bit.Core.Services
|
||||
["organizationName"] = WebUtility.HtmlEncode(organizationName),
|
||||
["url"] = string.Format("{0}/accept-organization?organizationId={1}&organizationUserId={2}" +
|
||||
"&email={3}&organizationName={4}&token={5}",
|
||||
_globalSettings.BaseServiceUri.Vault,
|
||||
_globalSettings.BaseServiceUri.VaultWithHash,
|
||||
orgUser.OrganizationId,
|
||||
orgUser.Id,
|
||||
WebUtility.UrlEncode(orgUser.Email),
|
||||
@ -163,7 +163,7 @@ namespace Bit.Core.Services
|
||||
{
|
||||
var model = new Dictionary<string, string>
|
||||
{
|
||||
["vaultUrl"] = _globalSettings.BaseServiceUri.Vault
|
||||
["vaultUrl"] = _globalSettings.BaseServiceUri.VaultWithHash
|
||||
};
|
||||
|
||||
var message = await CreateMessageAsync("Welcome", user.Email, "Welcome", model);
|
||||
|
@ -37,7 +37,7 @@ namespace Bit.Core.Services
|
||||
{
|
||||
Token = WebUtility.UrlEncode(token),
|
||||
UserId = userId,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||
SiteName = _globalSettings.SiteName
|
||||
};
|
||||
message.HtmlContent = _engine.Parse("VerifyEmail", model);
|
||||
@ -54,7 +54,7 @@ namespace Bit.Core.Services
|
||||
{
|
||||
Token = WebUtility.UrlEncode(token),
|
||||
UserId = userId,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||
SiteName = _globalSettings.SiteName,
|
||||
Email = email,
|
||||
EmailEncoded = WebUtility.UrlEncode(email)
|
||||
@ -73,7 +73,7 @@ namespace Bit.Core.Services
|
||||
{
|
||||
FromEmail = fromEmail,
|
||||
ToEmail = toEmail,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||
SiteName = _globalSettings.SiteName
|
||||
};
|
||||
message.HtmlContent = _engine.Parse("ChangeEmailAlreadyExists", model);
|
||||
@ -87,7 +87,7 @@ namespace Bit.Core.Services
|
||||
var model = new EmailTokenViewModel
|
||||
{
|
||||
Token = token,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||
SiteName = _globalSettings.SiteName
|
||||
};
|
||||
message.HtmlContent = _engine.Parse("ChangeEmail", model);
|
||||
@ -103,7 +103,7 @@ namespace Bit.Core.Services
|
||||
var model = new EmailTokenViewModel
|
||||
{
|
||||
Token = token,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||
SiteName = _globalSettings.SiteName
|
||||
};
|
||||
message.HtmlContent = _engine.Parse("TwoFactorEmail", model);
|
||||
@ -119,7 +119,7 @@ namespace Bit.Core.Services
|
||||
var model = new MasterPasswordHintViewModel
|
||||
{
|
||||
Hint = hint,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||
SiteName = _globalSettings.SiteName
|
||||
};
|
||||
message.HtmlContent = _engine.Parse("MasterPasswordHint", model);
|
||||
@ -132,7 +132,7 @@ namespace Bit.Core.Services
|
||||
var message = CreateDefaultMessage("Your Master Password Hint", email);
|
||||
var model = new BaseMailModel
|
||||
{
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||
SiteName = _globalSettings.SiteName
|
||||
};
|
||||
message.HtmlContent = _engine.Parse("NoMasterPasswordHint", model);
|
||||
@ -148,7 +148,7 @@ namespace Bit.Core.Services
|
||||
{
|
||||
OrganizationName = organizationName,
|
||||
UserEmail = userEmail,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||
SiteName = _globalSettings.SiteName
|
||||
};
|
||||
message.HtmlContent = _engine.Parse("OrganizationUserAccepted", model);
|
||||
@ -162,7 +162,7 @@ namespace Bit.Core.Services
|
||||
var model = new OrganizationUserConfirmedViewModel
|
||||
{
|
||||
OrganizationName = organizationName,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||
SiteName = _globalSettings.SiteName
|
||||
};
|
||||
message.HtmlContent = _engine.Parse("OrganizationUserConfirmed", model);
|
||||
@ -181,7 +181,7 @@ namespace Bit.Core.Services
|
||||
OrganizationUserId = orgUser.Id.ToString(),
|
||||
Token = WebUtility.UrlEncode(token),
|
||||
OrganizationNameUrlEncoded = WebUtility.UrlEncode(organizationName),
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||
SiteName = _globalSettings.SiteName
|
||||
};
|
||||
message.HtmlContent = _engine.Parse("OrganizationUserInvited", model);
|
||||
@ -194,7 +194,7 @@ namespace Bit.Core.Services
|
||||
var message = CreateDefaultMessage("Welcome", user.Email);
|
||||
var model = new BaseMailModel
|
||||
{
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.Vault,
|
||||
WebVaultUrl = _globalSettings.BaseServiceUri.VaultWithHash,
|
||||
SiteName = _globalSettings.SiteName
|
||||
};
|
||||
message.HtmlContent = _engine.Parse("Welcome", model);
|
||||
|
@ -214,7 +214,7 @@ namespace Bit.Core.Services
|
||||
}
|
||||
|
||||
AddSubstitution(message, "{{siteName}}", _globalSettings.SiteName);
|
||||
AddSubstitution(message, "{{baseVaultUri}}", string.Concat(_globalSettings.BaseServiceUri.Vault, "/#"));
|
||||
AddSubstitution(message, "{{baseVaultUri}}", _globalSettings.BaseServiceUri.VaultWithHash);
|
||||
|
||||
return message;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user