# 2段階認証が強制されているユーザーのなりすまし解除ができない

**URL:** https://meta.discourse.org/t/unable-to-end-impersonation-for-2fa-enforced-user/411486
**Category:** Bug
**Tags:** impersonate, 2fa, fixed
**Created:** [2026 年 9 月 2 日午後 4:13 UTC](https://meta.discourse.org/t/unable-to-end-impersonation-for-2fa-enforced-user/411486 "2026-09-02T16:13:00Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![Eviepayne](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviepayne/32/352733_2.png) [@Eviepayne](https://meta.discourse.org/u/Eviepayne)
#### Post date: [2026 年 9 月 2 日午後 4:13 UTC](https://meta.discourse.org/t/unable-to-end-impersonation-for-2fa-enforced-user/411486/1 "2026-09-02T16:13:00Z")

</div>

フォーラムのユーザーが2段階認証（2FA）について質問していたので、トラブルシューティングのためにそのユーザーになりすまして対応していました。

強制設定された2FAがすべてのルーティングを壊しているため、なりすまし状態から抜け出せません。

 ![image](https://global.discourse-cdn.com/meta/original/4X/1/8/e/18ee9cada5468f49b3d694be0699b31af6f802da.png)

---

<div class="post-metadata">

### Author: ![Alteras](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alteras/32/179824_2.png) [@Alteras](https://meta.discourse.org/u/Alteras)
#### Post date: [2026 年 9 月 2 日午後 5:04 UTC](https://meta.discourse.org/t/unable-to-end-impersonation-for-2fa-enforced-user/411486/2 "2026-09-02T17:04:15Z")

</div>

どのバージョンのDiscourseを使用していますか？

当面の間、ブラウザのCookieをクリアすることで、強制的にログアウトできるはずです。

---

<div class="post-metadata">

### Author: ![Eviepayne](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/eviepayne/32/352733_2.png) [@Eviepayne](https://meta.discourse.org/u/Eviepayne)
#### Post date: [2026 年 9 月 2 日午後 5:05 UTC](https://meta.discourse.org/t/unable-to-end-impersonation-for-2fa-enforced-user/411486/3 "2026-09-02T17:05:31Z")

</div>

すでにその処理は行いました。これは明らかに意図しない動作であることを報告するだけです。

---

<div class="post-metadata">

### Author: ![Alteras](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alteras/32/179824_2.png) [@Alteras](https://meta.discourse.org/u/Alteras)
#### Post date: [2026 年 9 月 2 日午後 9:58 UTC](https://meta.discourse.org/t/unable-to-end-impersonation-for-2fa-enforced-user/411486/5 "2026-09-02T21:58:08Z")

</div>

修正完了！

> <https://github.com/discourse/discourse/pull/43137>
>
> Fixes an edge case where an user can get stuck impersonating another user withou…t 2FA, when 2FA enforcement is enabled. The impersonation correctly shows the user can only interact with UI elements for adding 2FA. But this restriction extends to the closing the impersonation session.
> 
> This commit fixes this by ensuring the DELETE /admin/impersonate endpoint is always accessible.

---

<div class="post-metadata">

### Author: ![Alteras](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/alteras/32/179824_2.png) [@Alteras](https://meta.discourse.org/u/Alteras)
#### Post date: [2026 年 9 月 3 日午後 3:00 UTC](https://meta.discourse.org/t/unable-to-end-impersonation-for-2fa-enforced-user/411486/9 "2026-09-03T15:00:47Z")

</div>

このトピックは17時間後に自動的に閉じられました。新しい返信は受け付けられていません。
