Skip to content

[EE] Fix a bug where internal email pattern wasn't respected

EE MR for https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/22516.

What does this MR do?

This fixes an issue where the "internal email address pattern" was being ignored unless the current_user given to Users::BuildService is an admin.

This bug was detected while logging in as a LDAP user (#52940) but it also happens for regular user sign ups too.

The fix is to set the external param based on the "internal email address pattern" (if enabled) regardless of the current_user, and if it hasn't been overridden before (only possible if current_user is an admin).

What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/52940.

Does this MR meet the acceptance criteria?

Edited by Rémy Coutable

Merge request reports