aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/disable2fa/+server.ts
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-08-30 20:04:29 -0700
committerAdam Soltys <[email protected]>2024-08-30 20:04:29 -0700
commitc9acca0218d47226c567da62c4a8bf97691c9b0d (patch)
tree3986d1c5aac77f256ed1091290bc067c899e2196 /src/routes/(app)/disable2fa/+server.ts
parent9a7bb1df8ce1cff544982520add7ca8fdee799f6 (diff)
downloadcoinos-ui-c9acca0218d47226c567da62c4a8bf97691c9b0d.tar.gz
coinos-ui-c9acca0218d47226c567da62c4a8bf97691c9b0d.zip
typescript
Diffstat (limited to 'src/routes/(app)/disable2fa/+server.ts')
-rw-r--r--src/routes/(app)/disable2fa/+server.ts13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/routes/(app)/disable2fa/+server.ts b/src/routes/(app)/disable2fa/+server.ts
new file mode 100644
index 00000000..0afda3b9
--- /dev/null
+++ b/src/routes/(app)/disable2fa/+server.ts
@@ -0,0 +1,13 @@
+import { error, json } from "@sveltejs/kit";
+import { auth, post } from "$lib/utils";
+
+export async function POST({ cookies, request }) {
+ try {
+ let body = await request.json();
+ let res = await post("/disable2fa", body, auth(cookies));
+
+ return json(res);
+ } catch (e) {
+ error(500, "Problem disabling 2fa");
+ }
+}