# Automatic addition of users to group based on email domain

**URL:** https://meta.discourse.org/t/automatic-addition-of-users-to-group-based-on-email-domain/147157
**Category:** SSO
**Created:** [April 7, 2020, 4:58pm UTC](https://meta.discourse.org/t/automatic-addition-of-users-to-group-based-on-email-domain/147157 "2020-04-07T16:58:15Z")
**Posts on this page:** 1
**Showing post:** 6

<div class="post-metadata">

### Author: ![sam](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/sam/32/102149_2.png) [@sam](https://meta.discourse.org/u/sam)
#### Post date: [April 8, 2020, 6:36am UTC](https://meta.discourse.org/t/automatic-addition-of-users-to-group-based-on-email-domain/147157/6 "2020-04-08T06:36:38Z")

</div>

I think this is the bug.

When you were updating emails via SSO cause you have `sso_overrides_email` enabled the auto group membership was not taking.

It would take for initial user creations.

Note, there is the whole “retroactive” concept that is massively confusing, we should probably just remove that. I recommend you make sure `Apply the same email domain rule to add existing registered users` is always set, we are going to be removing it.

[https://github.com/discourse/discourse/commit/b824898f614d21c43a78fec30481757341106d5a](https://github.com/discourse/discourse/commit/b824898f614d21c43a78fec30481757341106d5a)

---

_[View the full topic](https://meta.discourse.org/t/automatic-addition-of-users-to-group-based-on-email-domain/147157)._
