Changing Auth Provider #64
-
Hello, might be the wrong place for this, if thats the case, I am sorry. On a pretty much fresh copy of the Platforms git: I've been trying to add Google as an auth provider with the next-auth.js library, adding the provider, signing in and authorizing all seems fine and I can see that a "User" gets added in the prisma / planetscale mysql database. However it never transfers over to become an "Account". So it gives me a &error=Callback (Error in the OAuth callback handler route) and by trying to sign in again it hits me with the &error=OAuthAccountNotLinked (If the email on the account is already linked, but not with this OAuth account). I understand that this has to do with next auth stuff but I can'understand why the github example provided is working but the Google is not. Anyone know where I could start looking for a good example how to implement a Google provider with Next auth for Prisma / Planetscale or just straight up this git repo? Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 7 replies
-
Turns out I am a dum dum and didn't read this and forgot to update my database scheme to accept longer token.ids, the base project only works with Github because they have short enough token.ids to work without adding @db.Text to the prisma scheme.
|
Beta Was this translation helpful? Give feedback.
Turns out I am a dum dum and didn't read this and forgot to update my database scheme to accept longer token.ids, the base project only works with Github because they have short enough token.ids to work without adding @db.Text to the prisma scheme.
NOTE When using the MySQL connector for Prisma, the [Prisma String type](https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#string) gets mapped to varchar(191) which may not be long enough to store fields such as id_token in the Account model. This can be avoided by explicitly using the Text type with @db.Text.