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

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:

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.

3 Likes

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

1 Like

Done: 2FA Backup Code Download: Use CRLF for Windows-compatibility by sebix · Pull Request #29400 · discourse/discourse · GitHub

4 Likes

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

2 Likes