Skip to content

Changed basePath in auth.ts to match the official documentation #13166

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

jeremyko
Copy link

@jeremyko jeremyko commented Aug 9, 2025

(Next.js v15.4.6)
The official documentation (https://authjs.dev/guides/configuring-github) suggests setting the Callback URL to "http://localhost:3000/api/auth/callback/github", but the official example (apps/examples/nextjs) doesn't include an api folder. need to change the basePath in auth.ts to match the documentation (/api/auth). Also, when running the prettier command, if the path contains "[...]", the following error occurs:

[error] No files matching the pattern were found: "'apps/examples/nextjs/app/api/auth/[...nextauth]/route.ts'".

So, I added a path exception to lefthook.yml. There may be another way.

☕️ Reasoning

Modified the Next.js example to match the official documentation.

🧢 Checklist

  • Documentation
  • Tests
  • Ready to be merged

🎫 Affected issues

N/A

📌 Resources

…/auth")

(Next.js v15.4.6)
The official documentation (https://authjs.dev/guides/configuring-github) suggests
setting the Callback URL to "http://localhost:3000/api/auth/callback/github",
but the official example (https://github.com/nextauthjs/next-auth-example) doesn't include an api folder.
need to change the basePath in auth.ts to match the documentation.
Also, when running the prettier command, if the path contains "[...]", the following error occurs:

    [error] No files matching the pattern were found: "'apps/examples/nextjs/app/api/auth/[...nextauth]/route.ts'".

So, I added a path exception to lefthook.yml. This doesn't seem to be the best solution. There may be another way.
Copy link

vercel bot commented Aug 9, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
auth-docs ✅ Ready (Inspect) Visit Preview 💬 Add feedback Aug 9, 2025 5:03am
1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
next-auth-docs ⬜️ Ignored (Inspect) Visit Preview Aug 9, 2025 5:03am

Copy link

vercel bot commented Aug 9, 2025

@jeremyko is attempting to deploy a commit to the authjs Team on Vercel.

A member of the Team first needs to authorize it.

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

Successfully merging this pull request may close these issues.

1 participant