Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Chapter 15 - Missing Step to Create app/api/auth/[...nextauth]/route.ts #904

Open
jeffmatts opened this issue Oct 31, 2024 · 0 comments
Open

Comments

@jeffmatts
Copy link

jeffmatts commented Oct 31, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant