safak / next-blog

316 stars 318 forks source link

Problem with prisma adapter, I suddenly have an 0auth callback error, and I'm in a loop of callbacks. #11

Closed Lean-98 closed 1 year ago

Lean-98 commented 1 year ago

Hi there! I'm facing some issue with the signin at 2:41:50 mark. As soon as I have inserted a prisma adapter, I suddenly have an 0auth callback error, and I'm in a loop of callbacks.

http://localhost:3000/api/auth/signin?error=Callback

karshdev commented 1 year ago

@Lean-98 check your google cloud have you written exactly the same routes for providers https://localhost:3000/api/auth/callback/google

mozi47 commented 1 year ago

check your google cloud and it will be same URI: http://localhost:3000/api/auth/callback/google

in the .env make sure you have added NEXTAUTH_URL=http://localhost:3000,

clear the local storage and cookies.

Lean-98 commented 1 year ago

Thanks in the end I was able to solve it , the error was that I don't added the name to the database in the environment variable: DATABASE_URL="mongodb+srv://example:example@cluster0.8psrfxm.mongodb.net/blog?retryWrites=true&w=majority".