diff --git a/src/db/models/userModels.js b/src/db/models/userModels.js index a194af5..828d113 100644 --- a/src/db/models/userModels.js +++ b/src/db/models/userModels.js @@ -132,22 +132,6 @@ export const addCoursePurchaseToUser = async (userId, purchaseData) => { }; export const createUser = async (data) => { - // Check if a user with the given email already exists - let existingUser = null; - // todo: special condition for email login, should be handled before getting here - if (data?.email) { - existingUser = await prisma.user.findUnique({ - where: { email: data?.email }, - }); - } - - if (existingUser) { - console.log("user already exists", existingUser); - // If user exists, return the existing user - return existingUser; - } - - // If user does not exist, create a new user return await prisma.user.create({ data: { ...data, diff --git a/src/pages/api/auth/[...nextauth].js b/src/pages/api/auth/[...nextauth].js index 2e65e77..ad27b89 100644 --- a/src/pages/api/auth/[...nextauth].js +++ b/src/pages/api/auth/[...nextauth].js @@ -149,6 +149,9 @@ export const authOptions = { return null; } const fullUser = await getUserByPubkey(pk); + if (fullUser && fullUser.email === "austinkelsay@protonmail.com") { + console.log("FULLLSNDE", fullUser); + } token.user = fullUser; } catch (error) { console.error("Ephemeral key pair generation error:", error);