From 400d45389c63332a54920fc3c09db20a868f32d3 Mon Sep 17 00:00:00 2001 From: Slendy Date: Mon, 26 Dec 2022 16:21:16 -0600 Subject: [PATCH] Fix initial account setup email --- .../Controllers/MessageController.cs | 2 +- ProjectLighthouse/Helpers/SanitizationHelper.cs | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs b/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs index 03d7f753..62752d42 100644 --- a/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs +++ b/ProjectLighthouse.Servers.GameServer/Controllers/MessageController.cs @@ -105,7 +105,7 @@ along with this program. If not, see ."; $"If this was you, your {ServerConfiguration.Instance.Customization.ServerName} password can be set at the following link:\n" + $"{ServerConfiguration.Instance.ExternalUrl}/passwordReset?token={resetToken.ResetToken}"; - SMTPHelper.SendEmail(user.EmailAddress, $"Project Lighthouse Password Setup Request for {user.Username}", messageBody); + SMTPHelper.SendEmail(email, $"Project Lighthouse Password Setup Request for {user.Username}", messageBody); this.database.PasswordResetTokens.Add(resetToken); diff --git a/ProjectLighthouse/Helpers/SanitizationHelper.cs b/ProjectLighthouse/Helpers/SanitizationHelper.cs index d78ffceb..50366631 100644 --- a/ProjectLighthouse/Helpers/SanitizationHelper.cs +++ b/ProjectLighthouse/Helpers/SanitizationHelper.cs @@ -16,9 +16,7 @@ public static class SanitizationHelper {"'", "'"}, }; - public static bool IsValidEmail - (string? email) => - !string.IsNullOrWhiteSpace(email) && new EmailAddressAttribute().IsValid(email); + public static bool IsValidEmail(string? email) => !string.IsNullOrWhiteSpace(email) && new EmailAddressAttribute().IsValid(email); public static void SanitizeStringsInClass(object? instance) {