Next.js Discord

Discord Forum

Docs outdated with only /pages file structure

Answered
Greenish Elaenia posted this in #help-forum
Open in Discord
Greenish ElaeniaOP
https://nextjs.org/docs/pages/building-your-application/authentication#implementing-authentication
If a project has a /app file structure and tries to do
/api/auth/login.ts, 404 NOT FOUND will be returned when calling

await fetch('/api/auth/login');

The docs should point out that this example is for /pages setup, and also provide a second example for /app
Answered by joulev
https://nextjs.org/docs/app/building-your-application/authentication this is the corresponding page for the app router
View full answer

3 Replies