User stuck in 2FA setup page even if group disable 2FA enforce
Summary
When Group enforce 2FA, members of the group will be forced to setup 2FA. However, when the we remove the group 2FA enforcement. The member is still forced to setup the 2FA.
Steps to reproduce
- Have a group with members who do not have 2FA setup and have subgroup
- Go to Group Settings >
General
>Permissions, LFS, 2FA
> check theRequire all users in this group to setup Two-factor authentication
box and hitSave changes
- Do the same for a subgroup
- Log in as the user who doesn't have 2FA setup, see the 2FA setup screen and unable to navigate to different page
- Go to Group settings and un check the
Require all users in this group to setup Two-factor authentication
box andSave changes
for the top level group and then subgroup (The order is important) - Log in as the user who doesn't have 2FA setup again, observe that you're still stuck on the 2FA setup page
If you disable the subgroup first and then top level group, it will not trigger the bug.
Example Project
(If possible, please create an example project here on GitLab.com that exhibits the problematic behavior, and link to it here in the bug report)
(If you are using an older version of GitLab, this will also determine whether the bug is fixed in a more recent version)
What is the current bug behavior?
Disabling 2FA enforcement for groups and subgroup still force user to setup 2FA
What is the expected correct behavior?
Users are not forced to setup 2FA after the group 2FA enforcement is disabled.
Relevant logs and/or screenshots
Output of checks
This bug happens on GitLab.com; GitLab Enterprise Edition 13.1.0-pre 7b98ce20
Possible Workaround
Either one of the following:
- Remove users and add them back
- Enable 2FA for the group and subgroups again and disable the top level group last