Skip to content

Need to change the basePath in auth.ts to match the official documentation(OAuth). #13167

@jeremyko

Description

@jeremyko

Environment

System:
    OS: Windows 11 10.0.26100
    CPU: (8) x64 Intel(R) Core(TM) i7-9700 CPU @ 3.00GHz
    Memory: 14.11 GB / 31.91 GB
  Binaries:
    Node: 22.17.0 - C:\Program Files\nodejs\node.EXE
    Yarn: 1.22.10 - ~\AppData\Roaming\npm\yarn.CMD
    npm: 11.2.0 - C:\Program Files\nodejs\npm.CMD
    pnpm: 10.13.1 - ~\AppData\Local\pnpm\pnpm.CMD
  Browsers:
    Edge: Chromium (138.0.3351.55)
    Internet Explorer: 11.0.26100.1882
  npmPackages:
    next: 15.4.3 => 15.4.3
    next-auth: 5.0.0-beta.29 => 5.0.0-beta.29
    react: 19.1.0 => 19.1.0

Reproduction URL

It was reproduced when I ran "https://github.com/nextauthjs/next-auth-example".

Describe the issue

I submitted a PR: #13166

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.

How to reproduce

It was reproduced when I ran "https://github.com/nextauthjs/next-auth-example".

Expected behavior

If you change basePath in auth.ts to "/api/auth" to match the official documentation, the example will work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinginvalid reproductionThe issue did not have a detectable valid reproduction URLtriageUnseen or unconfirmed by a maintainer yet. Provide extra information in the meantime.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions