enforce disposable email policy on email verifications / changes

This commit is contained in:
Kyle Drake 2017-05-05 16:02:03 -07:00
parent 2e5cc9b243
commit 0e3b6ee3a0
2 changed files with 4 additions and 1 deletions

View file

@ -912,7 +912,7 @@ class Site < Sequel::Model
errors.add :email, 'Cannot use this email address.'
end
if parent? && new? && self.class.disposable_email?(values[:email])
if parent? && (values[:created_at].nil? || values[:created_at] > 1.week.ago) && self.class.disposable_email?(values[:email])
errors.add :email, 'Cannot use a disposable email address.'
end