Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 1 addition & 18 deletions src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,32 +45,16 @@ export const {
},
events: {
async linkAccount({ user }) {
console.log("OAuth account linked:", user.email);
if (user.id) {
await db.user.update({
where: { id: user.id },
data: { emailVerified: new Date() }
})
}
},
async signIn({ user, account, isNewUser }) {
console.log("Sign-in event:", {
userId: user.id,
email: user.email,
provider: account?.provider,
isNewUser
});
}
},
callbacks: {
async signIn({ user, account }) {
// Log sign-in attempt for debugging
console.log("Sign-in attempt:", {
userId: user.id,
provider: account?.provider,
email: user.email
});

if (!user.id) return false

if (account?.provider !== "credentials") return true
Expand Down Expand Up @@ -129,7 +113,6 @@ export const {
},
adapter: PrismaAdapter(db),
session: { strategy: "jwt" },
// Enable debug mode temporarily to get detailed error information
debug: true, // Set to true for both dev and production to debug
debug: process.env.NODE_ENV !== "production",
...authConfig,
})