UNPKG

create-auth-js-boiler

Version:
26 lines (21 loc) 514 B
import { prisma } from "./prisma"; export const getTwoFactorTokenByToken = async (token: string) => { try { const twoFactorToken = await prisma.twoFactorToken.findUnique({ where: { token }, }); return twoFactorToken; } catch { return null; } }; export const getTwoFactorTokenByEmail = async (email: string) => { try { const twoFactorToken = await prisma.twoFactorToken.findFirst({ where: { email }, }); return twoFactorToken; } catch { return null; } };