Cannot enable 2FA as Ip restriction range can't be blank

Summary

Cannot enable 2FA without also setting Restrict access by IP address.

Restrict access by IP address should be optional. You should be able to enforce 2FA independently of this option.

Steps to reproduce

  • Select gitlab.com group
  • Go to: Settings > General > Permissions, LFS, 2FA
  • Under Two-factor authentication tick Require all users in this group to setup Two-factor authentication
  • Save changes

What is the current bug behavior?

  • Fails to save change after selectingRequire all users in this group to setup Two-factor authentication and selecting Save changes
  • Returns error:
  The form contains the following errors:
  - Ip restriction range can't be blank
  - Ip restriction range is an invalid IP address range

What is the expected correct behavior?

  • Selecting Require all users in this group to setup Two-factor authentication and Save changes should enable the option. It should not be dependant on the Restrict access by IP address option.

Relevant logs and/or screenshots

  The form contains the following errors:
  - Ip restriction range can't be blank
  - Ip restriction range is an invalid IP address range

Screenshot_2019-07-01_at_17.47.58

Output of checks

This bug happens on GitLab.com

Assignee Loading
Time tracking Loading