diff options
Diffstat (limited to 'src/routes/(app)/disable2fa/+server.ts')
| -rw-r--r-- | src/routes/(app)/disable2fa/+server.ts | 13 |
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"); + } +} |
