Open jeffmatts opened 3 weeks ago
Let me first just say that this tutorial is amazing! I didn't experience any issues until chapter 15.
After first typing, then later pasting the code examples, I was receiving the following error with login and logout:
[auth][error] InvalidCallbackUrl: Invalid callback URL. Received: http://localhost:3000dashboard
Also, redirects and auth guards were not working.
After looking at some other examples, I realized that 'app/api/auth/[...nextauth]/route.ts' was missing. So I added the example code from https://authjs.dev/getting-started/installation?framework=Next.js.
import { handlers } from '@/auth'; export const { GET, POST } = handlers;
Once I added this, the error went away, and redirects and auth guards were working.
Let me first just say that this tutorial is amazing! I didn't experience any issues until chapter 15.
After first typing, then later pasting the code examples, I was receiving the following error with login and logout:
Also, redirects and auth guards were not working.
After looking at some other examples, I realized that 'app/api/auth/[...nextauth]/route.ts' was missing. So I added the example code from https://authjs.dev/getting-started/installation?framework=Next.js.
Once I added this, the error went away, and redirects and auth guards were working.