From 34d774e28b88eac932e20ce0029caecab7ad90bf Mon Sep 17 00:00:00 2001 From: nicolas-arnaud Date: Sun, 12 Mar 2023 17:00:51 +0100 Subject: [PATCH] fix profile button to enable/disable 2fa --- front/volume/src/components/Profile.svelte | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/front/volume/src/components/Profile.svelte b/front/volume/src/components/Profile.svelte index a95d35e..1124cf9 100644 --- a/front/volume/src/components/Profile.svelte +++ b/front/volume/src/components/Profile.svelte @@ -35,6 +35,7 @@ async function handle2fa(event: Event) { event.preventDefault(); + user.twoFA = !user.twoFA; let response = await fetch(API_URL, { headers: { "content-type": "application/json" }, method: "POST", @@ -42,8 +43,7 @@ credentials: "include", }); if (response.ok) { - alert("Succefully " + (user.twoFA ? "disabled" : "enabled") + " 2FA"); - user.twoFA = !user.twoFA; + alert("Succefully " + (user.twoFA ? "enabled" : "disabled") + " 2FA"); } }