# Downloaded Two-Factor Backup Codes are not separated on Windows (only LF newline)

**URL:** https://meta.discourse.org/t/downloaded-two-factor-backup-codes-are-not-separated-on-windows-only-lf-newline/331940
**Category:** Bug
**Tags:** 2fa
**Created:** [October 21, 2024, 5:20pm UTC](https://meta.discourse.org/t/downloaded-two-factor-backup-codes-are-not-separated-on-windows-only-lf-newline/331940 "2024-10-21T17:20:09Z")
**Posts on this page:** 6
**Page:** 1

<div class="post-metadata">

### Author: ![sebix1](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sebix1](https://meta.discourse.org/u/sebix1)
#### Post date: [October 21, 2024, 5:20pm UTC](https://meta.discourse.org/t/downloaded-two-factor-backup-codes-are-not-separated-on-windows-only-lf-newline/331940/1 "2024-10-21T17:20:09Z")

</div>

The downloaded file generated by the _Two-Factor Backup Codes_ function includes the 10 codes separated by an LF (`\n`) character.

Windows users will only see 320 characters in one line in this file instead of 10 separate codes.

The string with the backup codes is generated here:

> <https://github.com/discourse/discourse/blob/88449541a595514092b9d43640a47bd3e9dc601f/app/assets/javascripts/discourse/app/components/backup-codes.gjs#L41>

Can we add a carriage return character too? For Linux/macOS users, this will make no difference in viewing the file, but it fixes the problem for Windows users.

I can also open a PR for this issue myself if that makes the implementation easier, but I want this to be reported and possibly discussed first.

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [October 21, 2024, 7:16pm UTC](https://meta.discourse.org/t/downloaded-two-factor-backup-codes-are-not-separated-on-windows-only-lf-newline/331940/2 "2024-10-21T19:16:17Z")

</div>

Very reasonable suggestion, a PR would be most welcome. Thanks!

---

<div class="post-metadata">

### Author: ![sebix1](https://avatars.discourse-cdn.com/v4/letter/s/bcef8e/32.png) [@sebix1](https://meta.discourse.org/u/sebix1)
#### Post date: [October 24, 2024, 7:33pm UTC](https://meta.discourse.org/t/downloaded-two-factor-backup-codes-are-not-separated-on-windows-only-lf-newline/331940/3 "2024-10-24T19:33:30Z")

</div>

Done: [2FA Backup Code Download: Use CRLF for Windows-compatibility by sebix · Pull Request #29400 · discourse/discourse · GitHub](https://github.com/discourse/discourse/pull/29400)

---

<div class="post-metadata">

### Author: ![pmusaraj](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pmusaraj/32/119489_2.png) [@pmusaraj](https://meta.discourse.org/u/pmusaraj)
#### Post date: [November 11, 2024, 8:17pm UTC](https://meta.discourse.org/t/downloaded-two-factor-backup-codes-are-not-separated-on-windows-only-lf-newline/331940/4 "2024-11-11T20:17:03Z")

</div>

Thanks @sebix1, we can’t merge your PR until you sign the CLA, though.

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 24, 2025, 3:33pm UTC](https://meta.discourse.org/t/downloaded-two-factor-backup-codes-are-not-separated-on-windows-only-lf-newline/331940/6 "2025-02-24T15:33:38Z")

</div>

Just merged @sebix1’s PR

[https://github.com/discourse/discourse/pull/29400](https://github.com/discourse/discourse/pull/29400)

---

<div class="post-metadata">

### Author: ![zogstrip](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/zogstrip/32/512781_2.png) [@zogstrip](https://meta.discourse.org/u/zogstrip)
#### Post date: [February 25, 2025, 7:00am UTC](https://meta.discourse.org/t/downloaded-two-factor-backup-codes-are-not-separated-on-windows-only-lf-newline/331940/7 "2025-02-25T07:00:46Z")

</div>

This topic was automatically closed after 15 hours. New replies are no longer allowed.
