# 当使用 Oauth2 登录时，如果已有账户，希望通过邮箱关联账户

**URL:** <https://meta.discourse.org/t/when-i-use-oauth2-login-if-i-already-have-a-account-i-want-to-connect-them-by-email/188672>\
**Category:** Support\
**Created:** [2021年四月30日 08:03 UTC](https://meta.discourse.org/t/when-i-use-oauth2-login-if-i-already-have-a-account-i-want-to-connect-them-by-email/188672 "2021-04-30T08:03:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![wayyt\_cc3090](https://avatars.discourse-cdn.com/v4/letter/w/aca169/32.png) [@wayyt\_cc3090](https://meta.discourse.org/u/wayyt_cc3090)\
**Post date:** [2021年四月30日 08:03 UTC](https://meta.discourse.org/t/when-i-use-oauth2-login-if-i-already-have-a-account-i-want-to-connect-them-by-email/188672/1 "2021-04-30T08:03:37Z")

</div>

当我使用 OAuth2 登录时，如果我已经有一个账户，我想通过邮箱将它们关联起来。像这样，我不想收到“邮箱已被占用”的错误提示。我希望它们能够成功关联。

 ![image](https://global.discourse-cdn.com/meta/original/3X/b/e/becb2aea464ad29190d44cd4e4cddc70ab039a5f.png)

---

<div class="post-metadata">

**Author:** ![simon](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/simon/32/339122_2.png) [@simon](https://meta.discourse.org/u/simon)\
**Post date:** [2021年四月30日 16:35 UTC](https://meta.discourse.org/t/when-i-use-oauth2-login-if-i-already-have-a-account-i-want-to-connect-them-by-email/188672/2 "2021-04-30T16:35:35Z")

</div>

如果您的 OAuth2 站点正在验证用户的电子邮件地址，您可以启用 Discourse 站点设置中的 `oauth2 email verified`。启用该设置后，当用户首次登录 Discourse 时，系统将根据电子邮件地址匹配现有账户。
