Migrating from nextauth/auth.js to better-auth
I'm currently in the process of migrating from auth.js to better-auth and have been following the guide here: https://www.better-auth.com/docs/guides/next-auth-migration-guide
I've been able to map or create the new columns per the guide (within schema.prisma), but now when I try to log in with Google I get the following error:
From my testing, this seems to be because of
I've been able to map or create the new columns per the guide (within schema.prisma), but now when I try to log in with Google I get the following error:
From my testing, this seems to be because of
@@id([providerId, accountId]) the error goes away when I replace this with a new id field/column in schema.prisma, but this would be a risky migration to run on a production database (it would break all existing references to the Account table). Are there any other solutions? Has anyone successfully migrated a production app from next-auth to better-auth?A step-by-step guide to transitioning from NextAuth.js to Better Auth.