Revert create user model, add log for debugging

This commit is contained in:
austinkelsay 2024-10-06 16:37:08 -05:00
parent 2ccf3b6e7b
commit 69843bff73
2 changed files with 3 additions and 16 deletions

View File

@ -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,

View File

@ -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);