Automatic registration domain wild card

Yeah there is an inconsistency internally, our automatic group membership is based off a strict domain match per:

https://github.com/discourse/discourse/blob/40546af21746d469e39dfdcc9ca48987fef6cf3c/app/jobs/regular/automatic_group_membership.rb#L19-L19

Our matcher for the email_domains_whitelist uses this match

https://github.com/discourse/discourse/blob/40546af21746d469e39dfdcc9ca48987fef6cf3c/lib/validators/email_validator.rb#L35-L35

I think it makes sense to make this coherent and consistent.

@techAPJ can you adjust the group regex… carefully and make sure it is tested so it also allows subdomains.

7 Likes