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.38k stars 688 forks source link

After login I am redirected to login page even though my callback url is set to the app domain #409

Closed dogpool closed 3 weeks ago

dogpool commented 3 weeks ago

https://github.com/vercel/platforms/assets/103909014/00d949fa-8d18-41ee-ae71-18cf642bd80a

This is a video of what happens when I click login, I am taken back to the login screen. I am assuming the problem lies within OAuth or the github authentication callback url?

My callback url https://app.iambragging.com/api/auth/callback/github

What logs/network inspection can I upload here so that people can help diagnose my issue? I am going to re-try on a completely new computer with new accounts etc maybe I just did an oopsie with the env variables. For context: First deployed the template from Vercel, did not change anything besides the env variables and vercel domains like said in guide. I would say I followed the guide to a T

dogpool commented 3 weeks ago

[next-auth][error][adapter_error_createUser] https://next-auth.js.org/errors#adapter_error_createuser null value in column "email" of relation "users" violates not-null constraint { message: 'null value in column "email" of relation "users" violates not-null constraint', stack: 'error: null value in column "email" of relation "users" violates not-null constraint\n' + ' at /var/task/.next/server/chunks/93.js:10:28986\n' + ' at process.processTicksAndRejections (node:internal/process/task_queues:95:5)\n' + ' at async b.execute (/var/task/.next/server/chunks/93.js:35:31022)', name: 'error' } This is the error I get

dogpool commented 3 weeks ago

okay I fixed this, this is if you do not have a public github email setup in your profile, NextAuth produces the above mentioned error in vercel logs without displaying to the user that they need to have a public email address setup. After I did this with my github, I was able to login finally. Tomorrow ill try to write a fix in the NextAuth file so that non-public emails can also be accepted somehow, but idk how yet.

image