Enhance: 2段階認証時のリカバリーコードのファイル名にサーバーURLを含めるように (#15677)

* enhance(frontend): include server hostname and port in 2fa recovery code filename

* chore(frontend): fix mistake(use `@` for indicate server hostname)

---------

Co-authored-by: syuilo <4439005+syuilo@users.noreply.github.com>
This commit is contained in:
Sayamame-beans
2025-03-19 19:34:57 +09:00
committed by GitHub
parent 3b20279e20
commit 71841e365e
3 changed files with 4 additions and 1 deletions

View File

@@ -106,6 +106,7 @@ SPDX-License-Identifier: AGPL-3.0-only
</template>
<script lang="ts" setup>
import { hostname, port } from '@@/js/config';
import { useTemplateRef, ref } from 'vue';
import MkButton from '@/components/MkButton.vue';
import MkModalWindow from '@/components/MkModalWindow.vue';
@@ -161,7 +162,7 @@ function downloadBackupCodes() {
const txtBlob = new Blob([backupCodes.value.join('\n')], { type: 'text/plain' });
const dummya = document.createElement('a');
dummya.href = URL.createObjectURL(txtBlob);
dummya.download = `${$i.username}-2fa-backup-codes.txt`;
dummya.download = `${$i.username}@${hostname}` + (port !== '' ? `_${port}` : '') + '-2fa-backup-codes.txt';
dummya.click();
}
}