Skip to content

armgit / umami

Public Imported from GitHub
0

Umami is a privacy-first web and product analytics platform. Traffic, campaigns, behavior, conversions, and revenue in one place. No cookies, no surveillance, self-hosted or in the cloud.

494 B
Raw Blame
import prisma from '@/lib/prisma';
import { parseRequest } from '@/lib/request';
import { json, notFound } from '@/lib/response';

export async function POST(request: Request) {
  if (process.env.CLOUD_MODE) {
    return notFound();
  }

  const { auth, error } = await parseRequest(request);

  if (error) {
    return error();
  }

  const userId = auth.user.id;

  await prisma.client.twoFactorAuth.deleteMany({
    where: { userId, isEnabled: false },
  });

  return json({ ok: true });
}