feat(User): always allow reset_password_instructions

This commit is contained in:
simon lehericey 2024-05-31 14:33:40 +02:00
parent 7c514e3585
commit 819fa2cde2
No known key found for this signature in database
GPG key ID: CDE670D827C7B3C5
2 changed files with 7 additions and 0 deletions

View file

@ -41,6 +41,12 @@ class DeviseUserMailer < Devise::Mailer
end end
end end
def reset_password_instructions(record, token, opts = {})
bypass_unverified_mail_protection!
super
end
def self.critical_email?(action_name) def self.critical_email?(action_name)
true true
end end

View file

@ -73,6 +73,7 @@ RSpec.describe DeviseUserMailer, type: :mailer do
it "respect preferred domain" do it "respect preferred domain" do
expect(header_value("From", subject.message)).to include(CONTACT_EMAIL) expect(header_value("From", subject.message)).to include(CONTACT_EMAIL)
expect(subject.message.to_s).to include("#{ENV.fetch("APP_HOST_LEGACY")}/users/password") expect(subject.message.to_s).to include("#{ENV.fetch("APP_HOST_LEGACY")}/users/password")
expect(subject[BalancerDeliveryMethod::BYPASS_UNVERIFIED_MAIL_PROTECTION]).to be_present
end end
end end