From b2c73ccfc469c9faf109160c0e8aff40a78f96ca Mon Sep 17 00:00:00 2001 From: jvyden Date: Wed, 1 Jun 2022 17:06:59 -0400 Subject: [PATCH] Only redirect users to email verification if mail is enabled when resetting password --- .../Pages/PasswordResetPage.cshtml.cs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ProjectLighthouse.Servers.Website/Pages/PasswordResetPage.cshtml.cs b/ProjectLighthouse.Servers.Website/Pages/PasswordResetPage.cshtml.cs index 5a767460..6f744979 100644 --- a/ProjectLighthouse.Servers.Website/Pages/PasswordResetPage.cshtml.cs +++ b/ProjectLighthouse.Servers.Website/Pages/PasswordResetPage.cshtml.cs @@ -1,5 +1,6 @@ #nullable enable using JetBrains.Annotations; +using LBPUnion.ProjectLighthouse.Configuration; using LBPUnion.ProjectLighthouse.Helpers; using LBPUnion.ProjectLighthouse.PlayerData.Profiles; using LBPUnion.ProjectLighthouse.Servers.Website.Pages.Layouts; @@ -38,7 +39,8 @@ public class PasswordResetPage : BaseLayout await this.Database.SaveChangesAsync(); - if (!user.EmailAddressVerified) return this.Redirect("~/login/sendVerificationEmail"); + if (!user.EmailAddressVerified && ServerConfiguration.Instance.Mail.MailEnabled) + return this.Redirect("~/login/sendVerificationEmail"); return this.Redirect("~/"); }