feat: Introduce Prisma ORM client and initial database/authentication utilities.

This commit is contained in:
2026-03-02 16:06:16 +01:00
parent d28594a97c
commit 0edbba0f35
23 changed files with 21126 additions and 8 deletions

View File

@@ -1,6 +1,7 @@
import NextAuth from 'next-auth';
import Credentials from 'next-auth/providers/credentials';
import bcrypt from 'bcryptjs';
import { prisma } from '@/lib/prisma';
export const { handlers, signIn, signOut, auth } = NextAuth({
providers: [
@@ -13,10 +14,6 @@ export const { handlers, signIn, signOut, auth } = NextAuth({
async authorize(credentials) {
if (!credentials?.email || !credentials?.password) return null;
// Lazy import to avoid PrismaClient initialization during build
const { default: getDB } = await import('./prisma');
const prisma = getDB();
const user = await prisma.user.findUnique({
where: { email: credentials.email as string },
});