add feature flipping, just in case
This commit is contained in:
parent
cd2d772cd0
commit
363f70a3fc
3 changed files with 5 additions and 1 deletions
|
@ -29,7 +29,9 @@ class AgentConnect::AgentController < ApplicationController
|
|||
user_info, id_token, amr = AgentConnectService.user_info(params[:code], cookies.encrypted[NONCE_COOKIE_NAME])
|
||||
cookies.delete NONCE_COOKIE_NAME
|
||||
|
||||
if user_info['idp_id'] == MON_COMPTE_PRO_IDP_ID && !amr.include?('mfa')
|
||||
if user_info['idp_id'] == MON_COMPTE_PRO_IDP_ID &&
|
||||
!amr.include?('mfa') &&
|
||||
Flipper.enabled?(:agent_connect_2fa, Struct.new(:flipper_id).new(flipper_id: user_info['email']))
|
||||
# we need the id_token to disconnect the agent connect session later.
|
||||
# we cannot store it in the instructeur model because the user is not yet created
|
||||
# so we store it in a encrypted cookie
|
||||
|
|
|
@ -20,6 +20,7 @@ end
|
|||
# A list of features to be deployed on first push
|
||||
features = [
|
||||
:administrateur_web_hook,
|
||||
:agent_connect_2fa,
|
||||
:api_particulier,
|
||||
:attestation_v2,
|
||||
:blocking_pending_correction,
|
||||
|
|
|
@ -39,6 +39,7 @@ describe AgentConnect::AgentController, type: :controller do
|
|||
context 'and user_info returns some info' do
|
||||
before do
|
||||
expect(AgentConnectService).to receive(:user_info).with(code, nonce).and_return([user_info, id_token, amr])
|
||||
Flipper.enable(:agent_connect_2fa)
|
||||
end
|
||||
|
||||
context 'and the instructeur use mon_compte_pro' do
|
||||
|
|
Loading…
Reference in a new issue