在用户无法访问其账户时更改其电子邮件地址

:bookmark: This guide explains how to change a user’s email address when they can’t access their original email account and have forgotten their password.

:person_raising_hand: Required user level: Administrator

There are situations where you may need to change a user’s email address on their behalf, such as when they no longer have access to the email associated with their account. This often occurs after migrating from a preexisting system where users logged in with a username and password.

Changing the email address

To change a user’s email address:

  1. Go to the user’s preferences page as if you were that user.
    • You can access any user’s preference page by placing their username in this URL: https://discourse.example.com/u/USERNAME/preferences/.
  2. Click the button to show their email address.
  3. Click the wrench button next to the email address.
  4. Enter the new email address and click ‘change’ to update it.

:information_source: For regular users, only the new email address needs to be verified.

:warning: For staff members (admins and moderators), both the old and new email addresses must be verified for security reasons. If a staff member has lost access to their old email, you’ll need to temporarily remove their admin/mod privileges before resetting their email, or use the Rails console method described below.

Alternative method: Using the Rails console

If you need to skip verification of the new email address or change a staff member’s email, you can use the Rails console method.

For detailed instructions on this method, refer to this guide on changing staff email addresses from the console.

Reset password dialog

Discourse provides hints in the reset password dialog for users who have lost access to their original email address:

When users click the help button, they see this dialog:

The “our helpful staff” link directs users to the /about page of your site. To ensure users can contact you this way, make sure to provide contact information on the /about page.

You can customize the text of this dialog by going to /admin/customize/site-texts.

Last edited by @hugh 2024-07-05T01:16:48Z

Last checked by @hugh 2024-07-05T01:16:52Z

Check documentPerform check on document:
15 个赞

我有一个用户几乎处于这种情况。区别在于他们目前已登录。但是,他们不再可以访问他们的主电子邮件帐户。

他们是否可以添加辅助电子邮件地址,然后删除他们的主电子邮件地址?或者他们会在该过程中被锁定吗?

另外,根据我对上述文档的理解,它只是相信联系管理员的人确实是他们所说的那个人吗?似乎任何人都可以要求将任何帐户更改为新的电子邮件,然后接管该帐户。或者我错过了什么?

我猜 如果 你信任这个请求,这就是该怎么做——但这个如果取决于你。

有些论坛是为朋友、俱乐部、公司等设立的,管理员可能认识所有人或有办法验证身份。我认为我不会在用户遍布各地的论坛上这样做。

1 个赞

好的。

我想任何使用电子邮件进行验证的网站都会遇到这个问题。你失去了验证,也就失去了账户。

在这种情况下,我最终要求他们添加一个辅助电子邮件(他们提出请求时仍然登录着),然后删除他们(丢失的)主电子邮件地址。

2 个赞