# User.set\_automatic\_groups não é chamado para todos os logins sociais

**URL:** <https://meta.discourse.org/t/user-set-automatic-groups-is-not-called-for-all-social-logins/81579>\
**Category:** Bug\
**Created:** [Fevereiro 26, 2018, 6:50pm UTC](https://meta.discourse.org/t/user-set-automatic-groups-is-not-called-for-all-social-logins/81579 "2018-02-26T18:50:21Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [Fevereiro 26, 2018, 6:50pm UTC](https://meta.discourse.org/t/user-set-automatic-groups-is-not-called-for-all-social-logins/81579/1 "2018-02-26T18:50:21Z")

</div>

Our Google login provider has the following code:

```plaintext
def after_create_account(user, auth)
  data = auth[:extra_data]
  GoogleUserInfo.create({ user_id: user.id }.merge(data))
  if auth[:email_valid].to_s == 'true' && data[:email]&.downcase == user.email
    EmailToken.confirm(user.email_tokens.first.token)
    user.set_automatic_groups
  end
end

```

Specifically, `user.set_automatic_groups` ensures that automatic group rules are applied to the user. This function is not called by our other auto providers, including GitHub, Facebook, and Twitter. We should ensure that all social login provider call `user.set_automatic_groups`, or that the call is extracted to a shared function that all providers use.

cc @supermathie @n-b-sonar

---

_[View the full topic](https://meta.discourse.org/t/user-set-automatic-groups-is-not-called-for-all-social-logins/81579)._
