aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/disable2fa
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2022-11-09 10:53:41 -0800
committerAdam Soltys <[email protected]>2022-11-09 10:53:41 -0800
commita440e188e36d0b5e5e6e520f9fb311a691f3c4e0 (patch)
tree0fd1e422bd8195caccb2837a20d1bd97b94dfa82 /src/routes/(app)/disable2fa
parente55b44b42a5e384a807a2703d4744dd1392f227e (diff)
downloadcoinos-ui-a440e188e36d0b5e5e6e520f9fb311a691f3c4e0.tar.gz
coinos-ui-a440e188e36d0b5e5e6e520f9fb311a691f3c4e0.zip
settings fixes
Diffstat (limited to 'src/routes/(app)/disable2fa')
-rw-r--r--src/routes/(app)/disable2fa/+server.js13
1 files changed, 9 insertions, 4 deletions
diff --git a/src/routes/(app)/disable2fa/+server.js b/src/routes/(app)/disable2fa/+server.js
index 237da445..13fcb2b9 100644
--- a/src/routes/(app)/disable2fa/+server.js
+++ b/src/routes/(app)/disable2fa/+server.js
@@ -1,8 +1,13 @@
+import { error } from '@sveltejs/kit';
import { auth, post } from '$lib/utils';
-export async function PUT({ cookies, request }) {
- let body = await request.json();
- let res = await post('/disable2fa', body, auth(cookies));
+export async function POST({ cookies, request }) {
+ try {
+ let body = await request.json();
+ let res = await post('/disable2fa', body, auth(cookies));
- return new Response(JSON.stringify(res));
+ return new Response(JSON.stringify(res));
+ } catch (e) {
+ throw error(500, 'Problem disabling 2fa');
+ }
}