app: use Instructeur.bypass_email_login_token

This commit is contained in:
Pierre de La Morinerie 2021-11-25 15:37:40 +01:00
parent fdaaf7c587
commit ac07f05771
2 changed files with 2 additions and 2 deletions

View file

@ -224,7 +224,7 @@ class ApplicationController < ActionController::Base
def redirect_if_untrusted
if instructeur_signed_in? &&
sensitive_path &&
!feature_enabled?(:instructeur_bypass_email_login_token) &&
!current_instructeur.bypass_email_login_token &&
!IPService.ip_trusted?(request.headers['X-Forwarded-For']) &&
!trusted_device?

View file

@ -165,7 +165,7 @@ describe ApplicationController, type: :controller do
let(:sensitive_path) { true }
before do
Flipper.disable(:instructeur_bypass_email_login_token)
current_instructeur.update!(bypass_email_login_token: false)
end
context 'when the instructeur is signed_in' do