From e629d79f096dcb48a16c90994d1119d27cb38ed0 Mon Sep 17 00:00:00 2001 From: jvyden Date: Thu, 3 Mar 2022 17:11:13 -0500 Subject: [PATCH] Redirect user to email verification on signup, fix email address not setting on register --- ProjectLighthouse/Database.cs | 1 + ProjectLighthouse/Pages/RegisterForm.cshtml.cs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/ProjectLighthouse/Database.cs b/ProjectLighthouse/Database.cs index 22bf6baa..d21ccc57 100644 --- a/ProjectLighthouse/Database.cs +++ b/ProjectLighthouse/Database.cs @@ -76,6 +76,7 @@ public class Database : DbContext Password = password, LocationId = l.Id, Biography = username + " hasn't introduced themselves yet.", + EmailAddress = emailAddress, }; this.Users.Add(user); diff --git a/ProjectLighthouse/Pages/RegisterForm.cshtml.cs b/ProjectLighthouse/Pages/RegisterForm.cshtml.cs index 43480361..5c371aa8 100644 --- a/ProjectLighthouse/Pages/RegisterForm.cshtml.cs +++ b/ProjectLighthouse/Pages/RegisterForm.cshtml.cs @@ -73,6 +73,8 @@ public class RegisterForm : BaseLayout this.Response.Cookies.Append("LighthouseToken", webToken.UserToken); + if (ServerSettings.Instance.SMTPEnabled) return this.Redirect("~/login/sendVerificationEmail"); + return this.RedirectToPage(nameof(LandingPage)); }