Next.js Discord

Discord Forum

Cannot log in - /api/auth/login returns 404 error

Unanswered
Asiatic Lion posted this in #help-forum
Open in Discord
Asiatic LionOP
I'm deploying my NextJS app with Vercel and @auth0/nextjs-auth0. My vercel app is not able to find /api/auth/login even though it works locally. The login auth api route is /app/api/auth/[auth0]/route.js and the code for the route.js is:

// app/api/auth/[auth0]/route.js
import { handleAuth, handleLogout } from '@auth0/nextjs-auth0';

export const GET = handleAuth({
logout: handleLogout({ returnTo: ${process.env.AUTH0_BASE_URL} }),
});

I've tried looking everywhere for answers, but nothing is working. Please help we need this fix urgently!

0 Replies