# \#nextjs-auth0

**URL:** https://community.auth0.com/tag/nextjs-auth0/2076.md

[Latest](https://community.auth0.com/latest.md) · [Categories](https://community.auth0.com/categories.md) · [Tags](https://community.auth0.com/tags.md)

---

## [Nextjs-auth0 V3 lockfile peer dependencies list Next.js 15 but docs state no Next.js 15 support](https://community.auth0.com/t/nextjs-auth0-v3-lockfile-peer-dependencies-list-next-js-15-but-docs-state-no-next-js-15-support/199517)

<div class="topic-metadata">

**Author:** [@joseph.d.lim](https://community.auth0.com/u/joseph.d.lim)\
**Replies:** 2\
**Last updated:** [May 4, 2026, 9:17pm UTC](https://community.auth0.com/t/nextjs-auth0-v3-lockfile-peer-dependencies-list-next-js-15-but-docs-state-no-next-js-15-support/199517 "2026-05-04T21:17:30Z")

</div>

I am looking for clarification on the v3 nextjs-auth0 package with Next.js 15. It lists v15 in the lockfile but the README specifically states that 15 support requires v4 of the package. Can someone please help me unders…

---

## [Next.js Edge Runtime build warning: Auth0 loads Node crypto via @auth0/nextjs-auth0 when used in middleware](https://community.auth0.com/t/next-js-edge-runtime-build-warning-auth0-loads-node-crypto-via-auth0-nextjs-auth0-when-used-in-middleware/196174)

<div class="topic-metadata">

**Author:** [@ReetamBG](https://community.auth0.com/u/ReetamBG)\
**Replies:** 1\
**Last updated:** [January 12, 2026, 5:51pm UTC](https://community.auth0.com/t/next-js-edge-runtime-build-warning-auth0-loads-node-crypto-via-auth0-nextjs-auth0-when-used-in-middleware/196174 "2026-01-12T17:51:54Z")

</div>

I’m getting this warning during next build: ./node\_modules/@auth0/nextjs-auth0/dist/utils/dpopUtils.js A Node.js module is loaded ('crypto' at line 1) which is not supported in the Edge Runtime. Learn More: https://next…

---

## [How to properly use protected api routes in Next.js?](https://community.auth0.com/t/how-to-properly-use-protected-api-routes-in-next-js/193489)

<div class="topic-metadata">

**Author:** [@ronaldruzicka](https://community.auth0.com/u/ronaldruzicka)\
**Replies:** 1\
**Last updated:** [October 23, 2025, 3:03pm UTC](https://community.auth0.com/t/how-to-properly-use-protected-api-routes-in-next-js/193489 "2025-10-23T15:03:29Z")

</div>

Hi, I would like to ask how to properly use protected API Routes in Next.js using Next.js SDK. In the migration guide from v3 to v4 you mention that withApiAuthRequired has been removed from the SDK, but it’s still ther…

---

## [Customizing Polling Behavior in useUser Hook](https://community.auth0.com/t/customizing-polling-behavior-in-useuser-hook/193002)

<div class="topic-metadata">

**Author:** [@Yazan-Ali9](https://community.auth0.com/u/Yazan-Ali9)\
**Replies:** 1\
**Last updated:** [October 9, 2025, 12:14pm UTC](https://community.auth0.com/t/customizing-polling-behavior-in-useuser-hook/193002 "2025-10-09T12:14:46Z")

</div>

I’m currently using the useUser hook from the Auth0 Next.js SDK in my application. Upon reviewing the SDK’s documentation and source code, I’ve observed that the hook utilizes useSWR internally to fetch user data from th…

---

## [Preventing console errors when calling useUser() when user isn't logged in?](https://community.auth0.com/t/preventing-console-errors-when-calling-useuser-when-user-isnt-logged-in/187447)

<div class="topic-metadata">

**Author:** [@neilenns](https://community.auth0.com/u/neilenns)\
**Replies:** 4\
**Last updated:** [October 9, 2025, 12:12am UTC](https://community.auth0.com/t/preventing-console-errors-when-calling-useuser-when-user-isnt-logged-in/187447 "2025-10-09T00:12:08Z")

</div>

I’ve got my nextjs app up and running with the nextjs-auth0 SDK, including route protection and RBAC validation on the client. I have pages users are allowed to view when not logged in, and I conditionally show UI based…

---

## [Using nextjs-auth0 v4 in a multi-tenant app](https://community.auth0.com/t/using-nextjs-auth0-v4-in-a-multi-tenant-app/183313)

<div class="topic-metadata">

**Author:** [@ccarse](https://community.auth0.com/u/ccarse)\
**Replies:** 3\
**Last updated:** [March 6, 2025, 8:10pm UTC](https://community.auth0.com/t/using-nextjs-auth0-v4-in-a-multi-tenant-app/183313 "2025-03-06T20:10:44Z")

</div>

I’m building a multi-tenant app based on vercel’s platforms example: github/vercel/platforms I’m struggling getting nextjs-auth0 to work. I’d like a single session that is shared across subdomains but haven’t been able t…

---

## [Customise error callback page (NextJS)](https://community.auth0.com/t/customise-error-callback-page-nextjs/188880)

<div class="topic-metadata">

**Author:** [@josh14](https://community.auth0.com/u/josh14)\
**Replies:** 2\
**Last updated:** [July 9, 2025, 7:24pm UTC](https://community.auth0.com/t/customise-error-callback-page-nextjs/188880 "2025-07-09T19:24:37Z")

</div>

Hi there, I’m trying to work out how to customise the callback page when there has been an authentication error, such as this one. Any help appreciated, I’m finding the docs quite limited and often incorrect since a big…

---

## [How to get a session in NextJS Middleware](https://community.auth0.com/t/how-to-get-a-session-in-nextjs-middleware/188482)

<div class="topic-metadata">

**Author:** [@relero90](https://community.auth0.com/u/relero90)\
**Replies:** 2\
**Last updated:** [June 30, 2025, 9:35pm UTC](https://community.auth0.com/t/how-to-get-a-session-in-nextjs-middleware/188482 "2025-06-30T21:35:21Z")

</div>

I have an application that was set up using NextJS 15.3.1 and the 4.0.0-beta.0 nextjs-auth0 SDK. I can see that this SDK has been brought into a stable version and am attempting to update to use it but am running into an…

---

## [V4 NextJS SDK Does Not Return Custom Fields on User idToken](https://community.auth0.com/t/v4-nextjs-sdk-does-not-return-custom-fields-on-user-idtoken/182538)

<div class="topic-metadata">

**Author:** [@relero90](https://community.auth0.com/u/relero90)\
**Replies:** 3\
**Last updated:** [March 25, 2025, 9:50pm UTC](https://community.auth0.com/t/v4-nextjs-sdk-does-not-return-custom-fields-on-user-idtoken/182538 "2025-03-25T21:50:45Z")

</div>

I am running into an issue described here: https://community.auth0.com/t/post-login-trigger-only-firing-for-one-application-in-my-tenant-why-not-the-others/182462 Basically, I have a custom action that is triggered post…

---

## [\[NextJS\] Link straight to signup page](https://community.auth0.com/t/nextjs-link-straight-to-signup-page/136836)

<div class="topic-metadata">

**Author:** [@wacanam20](https://community.auth0.com/u/wacanam20)\
**Replies:** 1\
**Last updated:** [February 27, 2025, 6:09pm UTC](https://community.auth0.com/t/nextjs-link-straight-to-signup-page/136836 "2025-02-27T18:09:43Z")

</div>

just add custom property corresponding to the path that you want e.g signup handleAuth({ signup: handleLogin({ authorizationParams: { screen\_hint: 'signup' } }) });

---

## [Meeting Edge runtime issue migrating to @auth0/nextjs-auth0 v0.4](https://community.auth0.com/t/meeting-edge-runtime-issue-migrating-to-auth0-nextjs-auth0-v0-4/182610)

<div class="topic-metadata">

**Author:** [@lzh](https://community.auth0.com/u/lzh)\
**Replies:** 1\
**Last updated:** [February 21, 2025, 7:17pm UTC](https://community.auth0.com/t/meeting-edge-runtime-issue-migrating-to-auth0-nextjs-auth0-v0-4/182610 "2025-02-21T19:17:30Z")

</div>

Hi, I’m migrating to @auth0/nextjs-auth0 v0.4 following the guide in the github doc. I’m meeting an issue where when the auth0 page tries to call /api/callback it raise error !!!!!!!!url: /auth/callback \[Error: A Node.…

---

## [Beta V4 NextJS SDK - Unable to Detect Host Before Initializing Auth0Client](https://community.auth0.com/t/beta-v4-nextjs-sdk-unable-to-detect-host-before-initializing-auth0client/182198)

<div class="topic-metadata">

**Author:** [@relero90](https://community.auth0.com/u/relero90)\
**Replies:** 2\
**Last updated:** [February 18, 2025, 11:09pm UTC](https://community.auth0.com/t/beta-v4-nextjs-sdk-unable-to-detect-host-before-initializing-auth0client/182198 "2025-02-18T23:09:48Z")

</div>

I am attempting to implement the nextjs-auth0 SDK on a NextJS application using Next 15. I am familiar with the v3 SDK but am having to use the beta v4 SDK because of the NextJS version on the UI I am building. The prob…

---

## [Login as patient (paswordless), login as provider (email): issue with nextjs-auth0](https://community.auth0.com/t/login-as-patient-paswordless-login-as-provider-email-issue-with-nextjs-auth0/182131)

<div class="topic-metadata">

**Author:** [@maxcarey](https://community.auth0.com/u/maxcarey)\
**Replies:** 1\
**Last updated:** [February 14, 2025, 11:11pm UTC](https://community.auth0.com/t/login-as-patient-paswordless-login-as-provider-email-issue-with-nextjs-auth0/182131 "2025-02-14T23:11:02Z")

</div>

I’m using @auth0/nextjs-auth0": “^3.5.0” In my next app, I have a login for one group of users which I want to be passwordless/sms (patients) and another group (providers), which I want to login as email: \<Link href="/…

---

## [Next.js & External API without Proxying requests through Next.js backend](https://community.auth0.com/t/next-js-external-api-without-proxying-requests-through-next-js-backend/109244)

<div class="topic-metadata">

**Author:** [@felix3](https://community.auth0.com/u/felix3)\
**Replies:** 2\
**Last updated:** [December 9, 2024, 5:19pm UTC](https://community.auth0.com/t/next-js-external-api-without-proxying-requests-through-next-js-backend/109244 "2024-12-09T17:19:09Z")

</div>

We are developing a Next.js frontend and an backend API that accepts Bearer Tokens (JWTs). We keep the backend separate for infrastructure and code management / framework reasons. How is it possible to securely access t…

---

## [How to resolve: "The access token expired and a refresh token is not available."](https://community.auth0.com/t/how-to-resolve-the-access-token-expired-and-a-refresh-token-is-not-available/139278)

<div class="topic-metadata">

**Author:** [@KevinM](https://community.auth0.com/u/KevinM)\
**Replies:** 2\
**Last updated:** [November 15, 2024, 11:49pm UTC](https://community.auth0.com/t/how-to-resolve-the-access-token-expired-and-a-refresh-token-is-not-available/139278 "2024-11-15T23:49:39Z")

</div>

I have a NextJS app router as my frontend, and an express API backend. Everything is going smoothly, I can get an access token in my nextJS client and send that to my express API for route protection. However I’m noti…

---

## [\[NextJS\] LoginHandlerError: Login handler failed. CAUSE: Discovery requests failing for {domain}, expected 200 OK, got: 404 Not Found](https://community.auth0.com/t/nextjs-loginhandlererror-login-handler-failed-cause-discovery-requests-failing-for-domain-expected-200-ok-got-404-not-found/141924)

<div class="topic-metadata">

**Author:** [@hearhere](https://community.auth0.com/u/hearhere)\
**Replies:** 2\
**Last updated:** [September 2, 2024, 7:04pm UTC](https://community.auth0.com/t/nextjs-loginhandlererror-login-handler-failed-cause-discovery-requests-failing-for-domain-expected-200-ok-got-404-not-found/141924 "2024-09-02T19:04:00Z")

</div>

Hello, I’m working to add Auth0 login to my NextJS application and I’m really struggling to get through the quickstart. To be specific, this one: Auth0 Next.js SDK Quickstarts: Login I’ve cloned the auth0-nextjs-sampl…

---

## [How to change the default API path for \`/me\` (and who called it)](https://community.auth0.com/t/how-to-change-the-default-api-path-for-me-and-who-called-it/139277)

<div class="topic-metadata">

**Author:** [@lzh](https://community.auth0.com/u/lzh)\
**Replies:** 1\
**Last updated:** [July 19, 2024, 6:02pm UTC](https://community.auth0.com/t/how-to-change-the-default-api-path-for-me-and-who-called-it/139277 "2024-07-19T18:02:56Z")

</div>

Hi, I’m trying a simple authentication with a different route path, in nextjs my layout.ts import { UserProvider } from "@auth0/nextjs-auth0/client"; import type { Metadata } from "next"; import { Inter } from "next/f…

---

## [NextJS Example invalid JWT](https://community.auth0.com/t/nextjs-example-invalid-jwt/135316)

<div class="topic-metadata">

**Author:** [@firebelly](https://community.auth0.com/u/firebelly)\
**Replies:** 1\
**Last updated:** [May 31, 2024, 10:22pm UTC](https://community.auth0.com/t/nextjs-example-invalid-jwt/135316 "2024-05-31T22:22:49Z")

</div>

Ready to post? :mag: First, try searching for your answer. I think I’m missing something here, but the quickstart at Auth0 Next.js SDK Quickstarts: Add Login to your Next.js application works fine, but the bearer tokens…

---

## [Empty Payload in Access Token using Next.js](https://community.auth0.com/t/empty-payload-in-access-token-using-next-js/134526)

<div class="topic-metadata">

**Author:** [@workize.io](https://community.auth0.com/u/workize.io)\
**Replies:** 1\
**Last updated:** [May 20, 2024, 4:52pm UTC](https://community.auth0.com/t/empty-payload-in-access-token-using-next-js/134526 "2024-05-20T16:52:20Z")

</div>

Hello! I am running in the same issue. I have just followed the documentation Auth0 Next.js SDK Quickstarts: Login and for some reason, my token does not have a payload.

---

## [@auth0/nextjs-auth0: Successful login but no session (on vercel)](https://community.auth0.com/t/auth0-nextjs-auth0-successful-login-but-no-session-on-vercel/131304)

<div class="topic-metadata">

**Author:** [@marcusabu](https://community.auth0.com/u/marcusabu)\
**Replies:** 4\
**Last updated:** [July 31, 2024, 9:10pm UTC](https://community.auth0.com/t/auth0-nextjs-auth0-successful-login-but-no-session-on-vercel/131304 "2024-07-31T21:10:33Z")

</div>

Hi all, Version: @auth0/nextjs-auth0:3.5.0 The login functionality stopped working for my app running in vercel. Locally the login flow still works fine. According to the logs, the callback method is successfully call…

---

## [Nextjs-auth0 stops to work in production](https://community.auth0.com/t/nextjs-auth0-stops-to-work-in-production/128388)

<div class="topic-metadata">

**Author:** [@pedroneto](https://community.auth0.com/u/pedroneto)\
**Replies:** 2\
**Last updated:** [March 21, 2024, 12:10pm UTC](https://community.auth0.com/t/nextjs-auth0-stops-to-work-in-production/128388 "2024-03-21T12:10:03Z")

</div>

Hello everyone, I’m encountering an issue with the nextjs-auth0 SDK. I followed all the necessary configurations to enable login in my application, as outlined in the tutorial on the Auth0 website. During development,…

---

## [Next.js SDK Callback url: The site can't be reached](https://community.auth0.com/t/next-js-sdk-callback-url-the-site-cant-be-reached/129311)

<div class="topic-metadata">

**Author:** [@phillip](https://community.auth0.com/u/phillip)\
**Replies:** 1\
**Last updated:** [March 9, 2024, 4:11am UTC](https://community.auth0.com/t/next-js-sdk-callback-url-the-site-cant-be-reached/129311 "2024-03-09T04:11:04Z")

</div>

Please see the attached screenshot that illustrates the error I’m seeing. I have everything configured according to the quickstart, and I’ve used this out of the box solution of Auth0 in other projects just fine… This ti…

---

## [Host nextjs auth0 handlers at a different route name than "/api"](https://community.auth0.com/t/host-nextjs-auth0-handlers-at-a-different-route-name-than-api/124424)

<div class="topic-metadata">

**Author:** [@christian5](https://community.auth0.com/u/christian5)\
**Replies:** 2\
**Last updated:** [January 9, 2024, 8:15pm UTC](https://community.auth0.com/t/host-nextjs-auth0-handlers-at-a-different-route-name-than-api/124424 "2024-01-09T20:15:08Z")

</div>

My nextjs application has to host its server side api routes at /functions/ rather than /api. I’ve noticed that after logging in with auth0 it tries to redirect to the nextjs callback at /api/auth/callback. Is there anyw…

---

## [getSession unable to authenticate user in NextJS server-side](https://community.auth0.com/t/getsession-unable-to-authenticate-user-in-nextjs-server-side/121394)

<div class="topic-metadata">

**Author:** [@keegan.r.s21](https://community.auth0.com/u/keegan.r.s21)\
**Replies:** 2\
**Last updated:** [December 6, 2023, 3:33am UTC](https://community.auth0.com/t/getsession-unable-to-authenticate-user-in-nextjs-server-side/121394 "2023-12-06T03:33:53Z")

</div>

I’m trying to protect a data request that’s made in the api. My basic setup is this: In src/app/myroute/\[id\]/page.tsx: import { getSession } from "@auth0/nextjs-auth0/edge"; export default async function page(props: P…

---

## [TypeError: (0 , \_slug.handler) is not a function - nextjs 12/jest](https://community.auth0.com/t/typeerror-0-slug-handler-is-not-a-function-nextjs-12-jest/118131)

<div class="topic-metadata">

**Author:** [@harris.johnny](https://community.auth0.com/u/harris.johnny)\
**Replies:** 1\
**Last updated:** [October 11, 2023, 7:16pm UTC](https://community.auth0.com/t/typeerror-0-slug-handler-is-not-a-function-nextjs-12-jest/118131 "2023-10-11T19:16:52Z")

</div>

Next.js 12.3.4 with jest 29.7.0 using /src/pages/api/some/endpoint/\[slug\].js The endpoint works fine when I call it when running. But as a test i get the full error: (0 , \_slug.handler) is not a function TypeError: (0 …

---

## [Invalid Security Token in NextJS app](https://community.auth0.com/t/invalid-security-token-in-nextjs-app/117840)

<div class="topic-metadata">

**Author:** [@adrianoh](https://community.auth0.com/u/adrianoh)\
**Replies:** 2\
**Last updated:** [October 4, 2023, 9:59pm UTC](https://community.auth0.com/t/invalid-security-token-in-nextjs-app/117840 "2023-10-04T21:59:56Z")

</div>

Hey, as the title suggests I’m getting a “error=access\_denied&error\_description=The%20security%20token%20included%20in%20the%20request%20is%20invalid” in the URL of the callback from NextJS quickstart: Auth0 Next.js SDK …

---

## [Next App Router, link direct to sign up page?](https://community.auth0.com/t/next-app-router-link-direct-to-sign-up-page/117570)

<div class="topic-metadata">

**Author:** [@SpinUp](https://community.auth0.com/u/SpinUp)\
**Replies:** 3\
**Last updated:** [October 4, 2023, 9:29pm UTC](https://community.auth0.com/t/next-app-router-link-direct-to-sign-up-page/117570 "2023-10-04T21:29:29Z")

</div>

Every time I set up a new auth0, and something has changed in Next, I struggle to work out how to have a “Sign up” link. Does anyone know how to do it with the new App router? At the moment I just have the /api/auth/\[au…

---

## [Why does calling external API need to be proxied through Nextjs API route?](https://community.auth0.com/t/why-does-calling-external-api-need-to-be-proxied-through-nextjs-api-route/96997)

<div class="topic-metadata">

**Author:** [@vineetd](https://community.auth0.com/u/vineetd)\
**Replies:** 6\
**Last updated:** [October 3, 2023, 10:28pm UTC](https://community.auth0.com/t/why-does-calling-external-api-need-to-be-proxied-through-nextjs-api-route/96997 "2023-10-03T22:28:37Z")

</div>

I’m migrating an existing React app that uses auth0 react SDK to NextJs. In the original app, the frontend makes a direct api call to the backend by passing access token in the authorization header that it obtained from…

---

## [Nextjs app sending opaque token to my API](https://community.auth0.com/t/nextjs-app-sending-opaque-token-to-my-api/117666)

<div class="topic-metadata">

**Author:** [@nadajp](https://community.auth0.com/u/nadajp)\
**Replies:** 1\
**Last updated:** [October 3, 2023, 4:22pm UTC](https://community.auth0.com/t/nextjs-app-sending-opaque-token-to-my-api/117666 "2023-10-03T16:22:05Z")

</div>

Hi, I have a Java Spring Boot backend API and a Nextjs frontend app. After logging in, I try to access a protected endpoint and see this error in my API: Caused by: org.springframework.security.oauth2.jwt.BadJwtExceptio…

---

## [Lifecycle / Support timeline for npm packages](https://community.auth0.com/t/lifecycle-support-timeline-for-npm-packages/114427)

<div class="topic-metadata">

**Author:** [@mltsy-a16z](https://community.auth0.com/u/mltsy-a16z)\
**Replies:** 4\
**Last updated:** [August 30, 2023, 9:29pm UTC](https://community.auth0.com/t/lifecycle-support-timeline-for-npm-packages/114427 "2023-08-30T21:29:30Z")

</div>

I haven’t been able to find any kind of documented intention or policy around how long the old versions of the nextjs-auth0 SDK/package will be maintained and supported. Is 1.x currently being maintained/supported? Is …

[Next page](https://community.auth0.com/tag/nextjs-auth0/2076.md?match_all_tags=true&page=1&tags%5B%5D=nextjs-auth0)
