Automatic registration domain wild card

I’ve noticed a difference in behaviour between the email domains whitelist setting at registration - and the automatic registration email domains setting in manage groups.

I work in the NHS where users have email addresses with sub domains emails @organisation.nhs.uk

The whitelist lets them all register by adding top domain nhs.uk to the list. That works well for me.

If I add the same top domain nhs.uk to automatically add them to a group - it doesn’t add them - at least not retrospectively.

I would like the automatic group registration to behave as the whitelist does. I’ve tried a wildcard character asterisk but that doesn’t work.

Do you have any suggestions - other than going through and adding every sub domain?

2 Likes

Why would retrospective addition be expected here? Couldn’t that be surprising and possibly even dangerous in other contexts?

(Thinking about this more, perhaps a dynamic pop-up prompt “do you want to make this retrospective, it will affect {x} users?” would work better?)

4 Likes

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

Discourse 2.4 does give this prompt to include member already registered with the domain. It’s a great feature and works well, aside from this inconsistency.

Thank you :pray:

3 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.