Skip to content

Add comprehensive email validation for blocked users#8

Open
akshayutture-augment wants to merge 1 commit into
blocked-email-validation-prefrom
blocked-email-validation-post
Open

Add comprehensive email validation for blocked users#8
akshayutture-augment wants to merge 1 commit into
blocked-email-validation-prefrom
blocked-email-validation-post

Conversation

@akshayutture-augment

@akshayutture-augment akshayutture-augment commented Nov 14, 2025

Copy link
Copy Markdown

Test 3


Replicated from ai-code-review-evaluation/discourse-cursor#3


Note

Adds server-side blocked email validation with whitelist/blacklist support, updates signup to return structured errors, and prevents reusing rejected emails client-side.

  • Backend:
    • Email validation: Introduces EmailValidator applying SiteSetting whitelist/blacklist and new BlockedEmail.should_block? check; User now uses validates :email, email: true.
    • Blocked emails: Adds BlockedEmail model (tracks match_count, last_match_at, action_type) with migration create_blocked_emails.
    • Signup errors: UsersController#create now returns errors and values in JSON on failure.
    • I18n: Adds user.email.blocked message.
  • Frontend:
    • CreateAccountController: tracks rejectedEmails to invalidate previously failed accountEmail; emailValidation observes rejectedEmails.
  • Tests:
    • Adds specs for EmailValidator and BlockedEmail, plus blocked_email fabricator.

Written by Cursor Bugbot for commit 5f8a130. Configure here.

… many times each email address is blocked, and last time it was blocked. Move email validation out of User model and into EmailValidator. Signup form remembers which email addresses have failed and shows validation error on email field.
@akshayutture-augment

Copy link
Copy Markdown
Author

cursor review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no bugs!


Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants