Commit 9d734be1 authored by Luke Duncalfe's avatar Luke Duncalfe Committed by Mark Chao

Require confirmed email to enable 2FA

parent f21cb86d
......@@ -221,7 +221,7 @@ class Profiles::TwoFactorAuthsController < Profiles::ApplicationController
end
def ensure_verified_primary_email
return unless Feature.enabled?(:ensure_verified_primary_email_for_2fa)
return unless Feature.enabled?(:ensure_verified_primary_email_for_2fa, default_enabled: :yaml)
unless current_user.two_factor_enabled? || current_user.primary_email_verified?
redirect_to profile_emails_path, notice: s_('You need to verify your primary email first before enabling Two-Factor Authentication.')
......
......@@ -5,4 +5,4 @@ rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/340151
milestone: '14.3'
type: development
group: group::access
default_enabled: false
default_enabled: true
......@@ -35,8 +35,19 @@ still access your account if you lose your U2F / WebAuthn device.
## Enabling 2FA
There are multiple ways to enable two-factor authentication: by using a one-time
password authenticator or a U2F / WebAuthn device.
> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/35102) in GitLab 14.3, account email confirmation required.
There are multiple ways to enable two-factor authentication (2FA):
- Using a one-time password authenticator.
- Using a U2F / WebAuthn device.
In GitLab 14.3 and later, your account email must be confirmed to enable two-factor authentication.
FLAG:
On self-managed GitLab, account email confirmation requirement is enabled. To disable this
restriction, ask an administrator to
[disable the `ensure_verified_primary_email_for_2fa` flag](../../../administration/feature_flags.md).
### One-time password
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment