-
Notifications
You must be signed in to change notification settings - Fork 436
Description
Describe the problem
When using the latest Next.js v11.1.0, and having i18n routes enabled, any <Link /> that points to a protected page will fail. In Next.js 11.1, they removed the locale prefix from api routes, but it seems Auth0 package is still trying to redirect to a locale prefixed route.
I tried setting up "NEXT_PUBLIC_AUTH0_LOGIN="/api/auth/login"" in the .env file. Also tried to manually set the login route in the , but the issue persists
What was the expected behavior?
User should be redirected to /api/auth/login instead of /en/api/auth/login.
Reproduction
I created a sample codebox where you can see the issue. Clicking on the regular <a> link works fine (ignore the error page on the Auth0 side). But trying to reach the same package when using a <Link /> leads to a redirect to api route with a prefix.
https://codesandbox.io/s/peaceful-smoke-0iubu
Of course, the external Auth0 login page will show an error since there are no correct Auth0 for a real project, but just reaching the page can be considered a "success" in this case.
Environment
"@auth0/nextjs-auth0": "1.5.0",
"next": "11.1.0",
"react": "^16.13.1",
"react-dom": "^16.13.1"