mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 22:14:26 +01:00
Reverting changes, validate email only if it was provided
This commit is contained in:
@@ -50,11 +50,11 @@ namespace BTCPayServer.Controllers.GreenField
|
||||
[HttpPut("~/api/v1/server/email")]
|
||||
public async Task<IActionResult> ServerEmailSettings(ServerEmailSettingsData request)
|
||||
{
|
||||
if (!MailboxAddressValidator.IsMailboxAddress(request.From))
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(request.From) && !MailboxAddressValidator.IsMailboxAddress(request.From))
|
||||
ModelState.AddModelError(nameof(request.From), "Invalid email address");
|
||||
|
||||
if (!ModelState.IsValid)
|
||||
return this.CreateValidationError(ModelState);
|
||||
}
|
||||
|
||||
if (_policiesSettings.DisableStoresToUseServerEmailSettings == request.EnableStoresToUseServerEmailSettings)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user