mirror of
https://github.com/HeyPuter/puter.git
synced 2025-02-03 07:48:46 +08:00
Add confirmation for disabling 2FA
This commit is contained in:
parent
a628358c9f
commit
abbbf0d030
@ -1,3 +1,4 @@
|
|||||||
|
import UIAlert from "../UIAlert.js";
|
||||||
import UIWindow2FASetup from "../UIWindow2FASetup.js";
|
import UIWindow2FASetup from "../UIWindow2FASetup.js";
|
||||||
import UIWindowQR from "../UIWindowQR.js";
|
import UIWindowQR from "../UIWindowQR.js";
|
||||||
|
|
||||||
@ -99,6 +100,22 @@ export default {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$el_window.find('.disable-2fa').on('click', async function (e) {
|
$el_window.find('.disable-2fa').on('click', async function (e) {
|
||||||
|
const confirmation = i18n('disable_2fa_confirm');
|
||||||
|
const alert_resp = await UIAlert({
|
||||||
|
message: confirmation,
|
||||||
|
buttons:[
|
||||||
|
{
|
||||||
|
label: i18n('yes'),
|
||||||
|
value: true,
|
||||||
|
type: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
label: i18n('no'),
|
||||||
|
value: false,
|
||||||
|
},
|
||||||
|
]
|
||||||
|
})
|
||||||
|
if ( ! alert_resp ) return;
|
||||||
const resp = await fetch(`${api_origin}/auth/configure-2fa/disable`, {
|
const resp = await fetch(`${api_origin}/auth/configure-2fa/disable`, {
|
||||||
method: 'POST',
|
method: 'POST',
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -91,6 +91,7 @@ const en = {
|
|||||||
developers: "Developers",
|
developers: "Developers",
|
||||||
dir_published_as_website: `%strong% has been published to:`,
|
dir_published_as_website: `%strong% has been published to:`,
|
||||||
disable_2fa: 'Disable 2FA',
|
disable_2fa: 'Disable 2FA',
|
||||||
|
disable_2fa_confirm: "Are you sure you want to disable 2FA?",
|
||||||
disassociate_dir: "Disassociate Directory",
|
disassociate_dir: "Disassociate Directory",
|
||||||
download: 'Download',
|
download: 'Download',
|
||||||
download_file: 'Download File',
|
download_file: 'Download File',
|
||||||
|
Loading…
Reference in New Issue
Block a user