Skip to content
代码片段 群组 项目
未验证 提交 7a10efc3 编辑于 作者: Smriti Garg's avatar Smriti Garg 提交者: GitLab
浏览文件

Merge branch 'el-add-feature-flag-actor' into 'master'

Add actor to auto_request_phone_number_verification_exemption FF

See merge request https://gitlab.com/gitlab-org/gitlab/-/merge_requests/144714



Merged-by: default avatarSmriti Garg <sgarg@gitlab.com>
Approved-by: default avatarMarcos Rocha <mrocha@gitlab.com>
Approved-by: default avatarSmriti Garg <sgarg@gitlab.com>
Co-authored-by: default avatarEugie Limpin <elimpin@gitlab.com>
No related branches found
No related tags found
无相关合并请求
......@@ -28,11 +28,15 @@ def callback
end
def exempt_user_from_phone_number_verification
return unless ::Feature.enabled?(:auto_request_phone_number_verification_exemption, type: :gitlab_com_derisk)
user = callback.user
return unless user&.offer_phone_number_exemption?
return unless user
return unless ::Feature.enabled?(
:auto_request_phone_number_verification_exemption, user, type: :gitlab_com_derisk
)
return unless user.offer_phone_number_exemption?
user.create_phone_number_exemption!
Gitlab::EtagCaching::Store.new.touch(verification_state_identity_verification_path)
......
......@@ -31,7 +31,7 @@ class IdentityVerificationController < ApplicationController
layout 'minimal'
def show
push_frontend_feature_flag(:auto_request_phone_number_verification_exemption, type: :gitlab_com_derisk)
push_frontend_feature_flag(:auto_request_phone_number_verification_exemption, @user, type: :gitlab_com_derisk)
# We to perform cookie migration for tracking from logged out to log in
# calling this before tracking gives us access to request where the
......
......@@ -81,6 +81,7 @@
before do
allow(user).to receive(:offer_phone_number_exemption?).and_return(true)
stub_feature_flags(auto_request_phone_number_verification_exemption: user)
end
it 'exempts the user' do
......@@ -104,9 +105,9 @@
it_behaves_like 'does not invalidate verification_state_identity_verification_path cache'
end
context 'when auto_request_phone_number_verification_exemption feature flag is disabled' do
context 'when auto_request_phone_number_verification_exemption feature flag is disabled for user' do
before do
stub_feature_flags(auto_request_phone_number_verification_exemption: false)
stub_feature_flags(auto_request_phone_number_verification_exemption: create(:user))
end
it_behaves_like 'does not exempt the user'
......
0% 加载中 .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册