platforms icon indicating copy to clipboard operation
platforms copied to clipboard

Github login not working for some users using new DrizzleORM setup

Open mdichtler opened this issue 1 year ago • 2 comments

As the email is set to notNull for compatibility with NextAuth adapter, some Github users might not be able to login due to a setting on their profile: Keep my email addresses private - when checked Github returns null for the email, hence not allowing you to write to the model.

mdichtler avatar Jun 19 '24 12:06 mdichtler

I had to update the permissions within the github app I created for authentication within settings -> developer settings -> my app -> Permissions. Once this was updated the email address started getting populated in the Auth response

This makes more sense to me, as even when dealing with 3rd party OAuth flows, 99% of the time I always request the email scope anyway.

leccles1 avatar Jun 21 '24 08:06 leccles1

Just echoing this, I also had to add the email scope, would be great if we could add this step to the guide: https://vercel.com/guides/nextjs-multi-tenant-application And also deprecate step 3 (publishing Prisma schema) now Drizzle is being used.

hamishll avatar Jul 13 '24 11:07 hamishll

It would be great if this could be added to the platforms starter guide also since it needs the github app to authorize. Also needs updating the guide to switch from prisma to drizzle

jmredfern avatar Mar 21 '25 12:03 jmredfern

👋 We've updated this repo to have a more simplified example + a new guide:

  • https://github.com/vercel/platforms/pull/451
  • https://vercel.com/guides/nextjs-multi-tenant-application

leerob avatar May 11 '25 14:05 leerob