Update auth.ts

This commit is contained in:
PxlLoewe
2025-02-16 12:31:18 +01:00
parent 586a747486
commit d16433004f

View File

@@ -4,7 +4,7 @@ import {
} from 'next-auth'; } from 'next-auth';
import { PrismaAdapter } from '@next-auth/prisma-adapter'; import { PrismaAdapter } from '@next-auth/prisma-adapter';
import Credentials from 'next-auth/providers/credentials'; import Credentials from 'next-auth/providers/credentials';
import { PrismaClient } from '@prisma/client'; import { PrismaClient } from '@repo/db';
import bcrypt from 'bcryptjs'; import bcrypt from 'bcryptjs';
const prisma = new PrismaClient(); const prisma = new PrismaClient();
@@ -38,7 +38,7 @@ export const options: AuthOptions = {
maxAge: 30 * 24 * 60 * 60, maxAge: 30 * 24 * 60 * 60,
}, },
adapter: PrismaAdapter(prisma), adapter: PrismaAdapter(prisma as any),
callbacks: { callbacks: {
jwt: async ({ token, user }) => { jwt: async ({ token, user }) => {
if (user && 'firstname' in user) { if (user && 'firstname' in user) {