Browse Source

fix profile button to enable/disable 2fa

master
nicolas-arnaud 2 years ago
parent
commit
34d774e28b
  1. 4
      front/volume/src/components/Profile.svelte

4
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");
}
}
</script>

Loading…
Cancel
Save