# 2FA Backup codes

**URL:** https://meta.discourse.org/t/2fa-backup-codes/87038
**Category:** Feature
**Created:** [May 9, 2018, 5:59am UTC](https://meta.discourse.org/t/2fa-backup-codes/87038 "2018-05-09T05:59:15Z")
**Posts on this page:** 1
**Showing post:** 4

<div class="post-metadata">

### Author: ![maja](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/maja/32/129533_2.png) [@maja](https://meta.discourse.org/u/maja)
#### Post date: [June 7, 2018, 1:25pm UTC](https://meta.discourse.org/t/2fa-backup-codes/87038/4 "2018-06-07T13:25:49Z")

</div>

I’m looking into adding support for 2FA backup codes, this is what I came up so far and I’d really appreciate some feedback. This is very basic flow so far, but hopefully enough to raise some questions/points to consider.

In order to enable backup codes, primary method (TOTP) has to be enabled.

 ![Slice%201](https://global.discourse-cdn.com/meta/original/3X/0/7/073e9b0b886b5b7c7bf45317d0b1521de0ef2ee3.png)

After enabling backup codes, user gets to copy and store the codes. If user loses backup codes, they have to reset them and get the new set of codes.

 ![Slice%204](https://global.discourse-cdn.com/meta/original/3X/a/3/a37a389d64a10d5769a8660877769d2200d9676a.png)

Backup code can be used everywhere authentication code is required if device providing TOTP code is not available.

 ![Slice%202](https://global.discourse-cdn.com/meta/original/3X/f/3/f3190e22ed78837dab541d2a227d18b96fc24539.png)

This will be build upon the feature @featheredtoast initially built - using `user_second_factors`, and since you gave this some thought already I’d appreciate if you have any suggestions.

---

_[View the full topic](https://meta.discourse.org/t/2fa-backup-codes/87038)._
