aboutsummaryrefslogtreecommitdiffstats
path: root/src/routes/(app)/disable2fa/+server.js
blob: 13fcb2b901a2c5a3d474c88be7b5c68d8df58e24 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
import { error } 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 new Response(JSON.stringify(res));
	} catch (e) {
		throw error(500, 'Problem disabling 2fa');
	}
}