Skip to content

Conversation

@tomerqodo
Copy link

Benchmark PR plausible#5855

Type: Corrupted (contains bugs)

Original PR Title: Add ability to enforce 2FA for all members of the team
Original PR Description: ### Changes

Depends on plausible#5868 merged

This 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"

image

Enforcement can be toggled on and off at any time, but only by one of team owners:

image

Additionally, disabling enforcement of 2FA requires password confirmation for added security:

image

Members trying to access team with "Enforce 2FA" enabled but without 2FA setup yet are forcibly redirected to the first step of 2FA setup:

image

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:

image

Technicalities

The flag is stored in team's policy embed as an additional force_2fa property which defaults to false.

As this feature is available from both CE and EE, the policy embed 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 RequireAccount plug 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

  • Automated tests have been added

Changelog

  • Entry has been added to changelog

Documentation

  • Docs have been updated

Dark mode

  • The UI has been tested both in dark and light mode

Original PR URL: plausible#5855

Issues Breakdown

  • Total Issues: 6
  • Easy: 2
  • Medium: 3
  • Hard: 1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants