# Two Factor local login proposal

**URL:** <https://meta.discourse.org/t/two-factor-local-login-proposal/76689>\
**Category:** Feature\
**Created:** [2017 年 12 月 24 日午前 7:17 UTC](https://meta.discourse.org/t/two-factor-local-login-proposal/76689 "2017-12-24T07:17:59Z")\
**Posts on this page:** 1\
**Showing post:** 30

<div class="post-metadata">

**Author:** ![featheredtoast](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/featheredtoast/32/116994_2.png) [@featheredtoast](https://meta.discourse.org/u/featheredtoast)\
**Post date:** [2018 年 1 月 31 日午前 2:04 UTC](https://meta.discourse.org/t/two-factor-local-login-proposal/76689/30 "2018-01-31T02:04:52Z")

</div>

Worked this week at getting up to speed with qunit, and moving forward on most of the review items.

Done:

- Blocking previous codes - valid 2-factor auth tokens can only be authenticated once/30 seconds. ✅
  - I played with updating the “last used” any time the token was _attempted_ but that seemed to be overkill, and frustrating as to why a token would fail.

- Translatable texts. ✅
- Move second factor logic to a helper class. ✅
- Move second factor specific controller endpoints to its own controller. ✅
- Move serialization logic for 2-factor details in admin user views. ✅
- Add a login ember component for de-duplication ✅
- Fix up code formatting ✅
- Change verbiage of google authenticator ✅

Todo:

- js tests
- controller tests
- Add modal for explaining what 2fa with links to Google Authenticator/FreeOTP

Questions:

For reviewers, would it be easier to squash my changes in a new commit, or have an incremental “since last review” commit? Regardless, I will finish writing the tests and other todo items, and push it back up soon.

For running qunit tests, is there a way of quickly running a single test? As I’m building out a suite, It would be great to be able to build out expectations without having to re-run all tests each time.

---

_[View the full topic](https://meta.discourse.org/t/two-factor-local-login-proposal/76689)._
