aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/disable2fa/+server.ts
blob: 0d1c45735f9a9a1e4bdb2505be3c78d59d63c975 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { error, json } from "@sveltejs/kit";
import { auth, post } from "$lib/utils";

export async function POST({ cookies, request }) {
  try {
    const body = await request.json();
    const res = await post("/disable2fa", body, auth(cookies));

    return json(res);
  } catch {
    error(500, "Problem disabling 2fa");
  }
}