-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Add ability to enforce 2FA for all members of the team #5855
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
|
1ee0e1b to
6c1b2ac
Compare
ukutaht
reviewed
Nov 4, 2025
ukutaht
approved these changes
Nov 4, 2025
Co-authored-by: Uku Taht <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Changes
Depends on #5868mergedThis PR introduces ability to enforce 2FA for members of the team. It can only be toggled by team owners.
There's a new section under "Team Settings" > "General" called "Force Two-Factor Authentication"
Enforcement can be toggled on and off at any time, but only by one of team owners:
Additionally, disabling enforcement of 2FA requires password confirmation for added security:
Members trying to access team with "Enforce 2FA" enabled but without 2FA setup yet are forcibly redirected to the first step of 2FA setup:
User in such situation can either finish the setup or switch to another team. However, whenever they switch to the team with enforcement enabled they will be redirected to the setup until they complete it.
An e-mail notification is sent to all team members (except the owner user triggering the change) to help clarify why they got locked out of their dashboard:
Technicalities
The flag is stored in team's policy embed as an additional
force_2faproperty which defaults to false.As this feature is available from both CE and EE, the
policyembed is getting expose in CE as well. The column is added to CE in a CE-only migration which will be extracted from this PR once it's reviewed.The gating is done by
RequireAccountplug as the guarded routes perfectly overlap for both. The 2FA setup routes and team switch route are excluded from enforcement check, similarly like email verification routes are excluded for unverified user enforcement.Tests
Changelog
Documentation
Dark mode