Add email blacklist and refactor email validity checks

This commit is contained in:
FeTetra 2024-12-16 19:42:05 -05:00
commit 980a2af3c6
7 changed files with 71 additions and 23 deletions

View file

@ -39,7 +39,7 @@ public class SetEmailForm : BaseLayout
UserEntity? user = await this.Database.Users.FirstOrDefaultAsync(u => u.UserId == token.UserId);
if (user == null) return this.Redirect("~/login");
if (!SanitizationHelper.IsValidEmail(emailAddress))
if (!SMTPHelper.IsValidEmail(this.Database, emailAddress))
{
this.Error = this.Translate(ErrorStrings.EmailInvalid);
return this.Page();