mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
Add BlockedEmail, to block signups based on email. Track stats of how 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.
This commit is contained in:
@@ -194,7 +194,9 @@ class UsersController < ApplicationController
|
||||
else
|
||||
render json: {
|
||||
success: false,
|
||||
message: I18n.t("login.errors", errors: user.errors.full_messages.join("\n"))
|
||||
message: I18n.t("login.errors", errors: user.errors.full_messages.join("\n")),
|
||||
errors: user.errors.to_hash,
|
||||
values: user.attributes.slice("name", "username", "email")
|
||||
}
|
||||
end
|
||||
rescue ActiveRecord::StatementInvalid
|
||||
|
||||
Reference in New Issue
Block a user