mirror of
https://github.com/mastodon/mastodon.git
synced 2025-09-05 09:21:11 +00:00
Merge 4faaa6ed19
into 14cb5ff881
This commit is contained in:
commit
bf8bd41adc
|
@ -458,18 +458,16 @@ class User < ApplicationRecord
|
||||||
end
|
end
|
||||||
|
|
||||||
def sign_up_email_requires_approval?
|
def sign_up_email_requires_approval?
|
||||||
return false if email.blank?
|
return false if email_domain.blank?
|
||||||
|
|
||||||
_, domain = email.split('@', 2)
|
EmailDomainBlock.requires_approval?(approval_domains, attempt_ip: sign_up_ip)
|
||||||
return false if domain.blank?
|
end
|
||||||
|
|
||||||
records = []
|
def approval_domains
|
||||||
|
[email_domain].tap do |records|
|
||||||
# Doing this conditionally is not very satisfying, but this is consistent
|
# MX lookup is enabled only in production by default
|
||||||
# with the MX records validations we do and keeps the specs tractable.
|
records << DomainResource.new(email_domain).mx unless self.class.skip_mx_check?
|
||||||
records = DomainResource.new(domain).mx unless self.class.skip_mx_check?
|
end.flatten
|
||||||
|
|
||||||
EmailDomainBlock.requires_approval?(records + [domain], attempt_ip: sign_up_ip)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def sign_up_username_requires_approval?
|
def sign_up_username_requires_approval?
|
||||||
|
|
Loading…
Reference in New Issue
Block a user