Prevent user from bypassing domain signup restrictions
What does this MR do and why?
Describe in detail what your merge request does and why.
https://gitlab.com/gitlab-org/gitlab/-/issues/19337
Currently, a user can bypass the domain allowlist by creating an account with an email that is on the list, then changing their email to a domain that is not on the list. Similarly, they can create an account with a valid email, then update their profile to a domain that is on the denylist. They can also change their email to a restricted domain.
This MR checks the domain restrictions when a user changes their email. If the email domain is not valid, prevent the change and show the user an error:
Screenshots or screen recordings
These are strongly recommended to assist reviewers and reduce the time to merge your change.
How to set up and validate locally
Numbered steps to set up and validate the change are strongly suggested.
- Admin > Settings > Sign-up restrictions > Allowed domains for sign-ups >
allowed.com
- Sign out, then register a new user
user@allowed.com
- Sign in as
user@allowed.com
, then Edit profile > Email >user@notallowed.com
Email is not valid. Please check with your administrator.
MR acceptance checklist
This checklist encourages us to confirm any changes have been analyzed to reduce risks in quality, performance, reliability, security, and maintainability.
-
I have evaluated the MR acceptance checklist for this MR.