Files
standardnotes-app-web/app/assets/javascripts/preferences/panes/two-factor-auth/download-secret-key.tsx
2021-07-27 14:42:30 +02:00

14 lines
439 B
TypeScript

// Temporary implementation until integration
export function downloadSecretKey(text: string) {
const link = document.createElement('a');
const blob = new Blob([text], {
type: 'text/plain;charset=utf-8',
});
link.href = window.URL.createObjectURL(blob);
link.setAttribute('download', 'standardnotes_2fa_key.txt');
document.body.appendChild(link);
link.click();
link.remove();
window.URL.revokeObjectURL(link.href);
}