[#10754] bypass unverified mail protection for login token emails

This commit is contained in:
Mathieu Magnin 2024-09-06 14:15:06 +02:00
parent 915779c9b0
commit 95eb9ef9d4
No known key found for this signature in database
GPG key ID: 8DCAFC82D7BA654E
2 changed files with 4 additions and 0 deletions

View file

@ -36,6 +36,8 @@ class InstructeurMailer < ApplicationMailer
@login_token = login_token @login_token = login_token
subject = "Connexion sécurisée à #{Current.application_name}" subject = "Connexion sécurisée à #{Current.application_name}"
bypass_unverified_mail_protection!
mail(to: instructeur.email, subject: subject) mail(to: instructeur.email, subject: subject)
end end

View file

@ -24,6 +24,8 @@ RSpec.describe InstructeurMailer, type: :mailer do
let(:token) { SecureRandom.hex } let(:token) { SecureRandom.hex }
subject { described_class.send_login_token(user, token) } subject { described_class.send_login_token(user, token) }
it { expect(subject[BalancerDeliveryMethod::BYPASS_UNVERIFIED_MAIL_PROTECTION]).to be_present }
context 'without SafeMailer configured' do context 'without SafeMailer configured' do
it { expect(subject[BalancerDeliveryMethod::FORCE_DELIVERY_METHOD_HEADER]&.value).to eq(nil) } it { expect(subject[BalancerDeliveryMethod::FORCE_DELIVERY_METHOD_HEADER]&.value).to eq(nil) }
end end