emails: hardcode nondisposable email list.

Hardcode the list of nondisposable email providers instead of making it
a config option. Also add a few new providers.

This was previously a config option to keep it secret, but there's not
much need for secrecy here.

A Restricted user's email must be on this list to unrestrict their
account. If a user is Restricted and their email is not in this list,
then it's assumed to be disposable and can't be used to unrestrict their
account even if they verify their email address.
This commit is contained in:
evazion
2021-09-05 18:21:35 -05:00
parent 19f01d4554
commit 28edd5a22a
4 changed files with 74 additions and 21 deletions

View File

@@ -32,7 +32,7 @@ class EmailAddress < ApplicationRecord
end
def self.restricted(restricted = true)
domains = Danbooru.config.email_domain_verification_list
domains = EmailValidator::NONDISPOSABLE_DOMAINS
domain_regex = domains.map { |domain| Regexp.escape(domain) }.join("|")
if restricted.to_s.truthy?