Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chan-mai committed Oct 3, 2024
1 parent a762d99 commit 20fbb3a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions packages/frontend/src/pages/settings/2fa.qrdialog.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ import MkKeyValue from '@/components/MkKeyValue.vue';
import MkInput from '@/components/MkInput.vue';
import { i18n } from '@/i18n.js';
import * as os from '@/os.js';
import * as config from '@/config.js';
import MkFolder from '@/components/MkFolder.vue';
import MkInfo from '@/components/MkInfo.vue';
import MkLink from '@/components/MkLink.vue';
Expand Down Expand Up @@ -155,10 +154,10 @@ async function tokenDone() {

function downloadBackupCodes() {
if (backupCodes.value !== undefined) {
const txtBlob = new Blob([backupCodes.value.reduce((acc, code, i) => `${acc}#${i + 1}. ${code}\r\n`, `${config.hostname} 2FA Backup Codes\r\n\r\n`)], { type: 'text/plain' });
const txtBlob = new Blob([backupCodes.value.join('\n')], { type: 'text/plain' });
const dummya = document.createElement('a');
dummya.href = URL.createObjectURL(txtBlob);
dummya.download = `${config.hostname}-${$i.username}-2fa-backup-codes.txt`;
dummya.download = `${$i?.username}-2fa-backup-codes.txt`;
dummya.click();
}
}
Expand Down

0 comments on commit 20fbb3a

Please sign in to comment.