# 电子邮件登录链接已过期

**URL:** <https://meta.discourse.org/t/email-login-link-is-too-old/146075>\
**Category:** Support\
**Created:** [2020年三月30日 03:05 UTC](https://meta.discourse.org/t/email-login-link-is-too-old/146075 "2020-03-30T03:05:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lona\_Lee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lona_lee/32/169072_2.png) [@Lona\_Lee](https://meta.discourse.org/u/Lona_Lee)\
**Post date:** [2020年三月30日 03:05 UTC](https://meta.discourse.org/t/email-login-link-is-too-old/146075/1 "2020-03-30T03:05:48Z")

</div>

我尝试通过 `http://mysite.com/users/admin-login` 登录。  
我的 Discourse 应用向我发送了一封包含登录链接的邮件，我点击该链接后被重定向到一个带有“完成登录”按钮的页面。我点击该按钮后，系统提示：

> 邮件登录链接已过期

这是怎么回事？我确定该链接根本没有过期。  
附注：已设置 “SiteSettings.force\_https = false”。  
提前感谢。

---

<div class="post-metadata">

**Author:** ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)\
**Post date:** [2020年三月30日 03:41 UTC](https://meta.discourse.org/t/email-login-link-is-too-old/146075/2 "2020-03-30T03:41:30Z")

</div>

您的服务器时间是否正确？我指的是运行 Discourse 的服务器。如果服务器时间不正确，可能会导致此问题。

---

<div class="post-metadata">

**Author:** ![Lona\_Lee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lona_lee/32/169072_2.png) [@Lona\_Lee](https://meta.discourse.org/u/Lona_Lee)\
**Post date:** [2020年三月30日 03:44 UTC](https://meta.discourse.org/t/email-login-link-is-too-old/146075/3 "2020-03-30T03:44:03Z")

</div>

是的，正确，是 UTC。还有其他需要检查的吗？

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2020年三月30日 03:53 UTC](https://meta.discourse.org/t/email-login-link-is-too-old/146075/4 "2020-03-30T03:53:58Z")

</div>

不是时区，是时间。

---

<div class="post-metadata">

**Author:** ![Lona\_Lee](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/lona_lee/32/169072_2.png) [@Lona\_Lee](https://meta.discourse.org/u/Lona_Lee)\
**Post date:** [2020年三月30日 04:59 UTC](https://meta.discourse.org/t/email-login-link-is-too-old/146075/5 "2020-03-30T04:59:54Z")

</div>

当然，时间是正确的。

---

<div class="post-metadata">

**Author:** ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)\
**Post date:** [2020年三月30日 11:48 UTC](https://meta.discourse.org/t/email-login-link-is-too-old/146075/6 "2020-03-30T11:48:50Z")

</div>

> [@Lona\_Lee](#):
>
> 仅供参考，“SiteSettings.force\_https = false”已设置。  
> 提前感谢。

这很可能是一个错误，因为很少有理由这样做，但它与当前问题无关。

我唯一见过此错误的情况是服务器上的系统时钟偏差了哪怕几分钟。建议您再次仔细检查时间和日期。

---

<div class="post-metadata">

**Author:** ![Stephen](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stephen/32/95011_2.png) [@Stephen](https://meta.discourse.org/u/Stephen)\
**Post date:** [2020年三月31日 01:10 UTC](https://meta.discourse.org/t/email-login-link-is-too-old/146075/7 "2020-03-31T01:10:08Z")

</div>

他们上面的示例 URL 指定了 HTTP，所以我希望他们实际上并未使用 HTTPS，即使封装发生在另一台设备或代理上。

编辑：在 [这个主题](https://meta.discourse.org/t/running-my-own-discourse-image/144555) 中，您谈到了运行一个分支版本，@Lona_Lee，您现在还在这样做吗？

---

<div class="post-metadata">

**Author:** ![stuwest](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/stuwest/32/192400_2.png) [@stuwest](https://meta.discourse.org/u/stuwest)\
**Post date:** [2022年四月23日 04:12 UTC](https://meta.discourse.org/t/email-login-link-is-too-old/146075/8 "2022-04-23T04:12:40Z")

</div>

我想为这个问题提供一个可能的解决方案，供将来搜索的人参考。最近从不同的论坛软件迁移到 Discourse 后，我的几位用户遇到了“登录链接太旧”的问题。

问题出在他们电子邮件地址中的大写字母。Discourse 非常非常不喜欢它们。一个简单的 `SET email = LOWER(email)` 查询可以立即解决问题。
