# 无法确认新邮箱，因为已启用双因素备份代码

**URL:** <https://meta.discourse.org/t/unable-to-confirm-new-email-when-two-factor-backup-codes-are-enabled/133185>\
**Category:** Bug\
**Created:** [2019 年11 月 12 日 10:59 UTC](https://meta.discourse.org/t/unable-to-confirm-new-email-when-two-factor-backup-codes-are-enabled/133185 "2019-11-12T10:59:46Z")\
**Posts on this page:** 1\
**Showing post:** 14

<div class="post-metadata">

作者： ![blake](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/blake/32/157322_2.png) [@blake](https://meta.discourse.org/u/blake)\
发布日期： [2019 年11 月 14 日 23:32 UTC](https://meta.discourse.org/t/unable-to-confirm-new-email-when-two-factor-backup-codes-are-enabled/133185/14 "2019-11-14T23:32:53Z")

</div>

此问题已通过以下提交修复：

> <https://github.com/discourse/discourse/commit/3b16eb7abb2986132d3f7fdfe36d1d21e0d650bb>
>
> This is a fix for this bug:
> 
> https://meta.discourse.org/t/-/133185?u=blake
> 
> wher…e rails would throw a missing template error when trying to confirm
> a new email address when you had two factor backup codes enabled.
> 
> Apparently this feature broke during this commit:
> 
> 68d35b14f4b5193c1bae0f175b9e461152e13ac7
> 
> when a partial that contained a lot of javascript was removed most
> likely because it didn't comply with our Content Security Policy, so as
> a fix I rewrote the previous js functionality without using any
> javascript and then added a spec to verify that the correct backup code
> form is displayed when that page is loaded.

---

_[View the full topic](https://meta.discourse.org/t/unable-to-confirm-new-email-when-two-factor-backup-codes-are-enabled/133185)._
