vercel / platforms

A full-stack Next.js app with multi-tenancy and custom domain support. Built with Next.js App Router and the Vercel Domains API.
https://app.vercel.pub
5.37k stars 688 forks source link

Github login not working for some users using new DrizzleORM setup #412

Open mdichtler opened 1 week ago

mdichtler commented 1 week ago

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.

leccles1 commented 1 week ago

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.