Update auth.ts
This commit is contained in:
@@ -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) {
|
||||||
|
|||||||
Reference in New Issue
Block a user