Server error in local
Unanswered
Argentine ant posted this in #help-forum
Argentine antOP
Why am I getting this error I have tried all the things from stackoverflow, here is my auth.ts:
import { env } from "@/env";
import { prisma } from "@/prisma";
import { stripe } from "@/stripe";
import { PrismaAdapter } from "@auth/prisma-adapter";
import NextAuth from "next-auth";
import Google from "next-auth/providers/google";
export const {
handlers,
auth: baseAuth,
signIn,
signOut,
} = NextAuth({
adapter: PrismaAdapter(prisma),
theme: {
logo: "/icon.png",
},
providers: [
Google({
clientId: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
}),
],
events: {
createUser: async (message) => {
const userId = message.user.id;
const userEmail = message.user.email;
if (!userEmail || !userId) {
return;
}
const stripeCustomer = await stripe.customers.create({
name: message.user.name ?? "",
email: userEmail,
});
await prisma.user.update({
where: {
id: userId,
},
data: {
stripeCustomerId: stripeCustomer.id,
},
});
},
},
});
import { env } from "@/env";
import { prisma } from "@/prisma";
import { stripe } from "@/stripe";
import { PrismaAdapter } from "@auth/prisma-adapter";
import NextAuth from "next-auth";
import Google from "next-auth/providers/google";
export const {
handlers,
auth: baseAuth,
signIn,
signOut,
} = NextAuth({
adapter: PrismaAdapter(prisma),
theme: {
logo: "/icon.png",
},
providers: [
Google({
clientId: env.GOOGLE_CLIENT_ID,
clientSecret: env.GOOGLE_CLIENT_SECRET,
}),
],
events: {
createUser: async (message) => {
const userId = message.user.id;
const userEmail = message.user.email;
if (!userEmail || !userId) {
return;
}
const stripeCustomer = await stripe.customers.create({
name: message.user.name ?? "",
email: userEmail,
});
await prisma.user.update({
where: {
id: userId,
},
data: {
stripeCustomerId: stripeCustomer.id,
},
});
},
},
});
1 Reply
check the server logs for more information