# Customise error callback page (NextJS)

**URL:** <https://community.auth0.com/t/customise-error-callback-page-nextjs/188880>\
**Category:** Get Help\
**Tags:** sdks-quickstarts, nextjs-auth0\
**Created:** [July 8, 2025, 9:34am UTC](https://community.auth0.com/t/customise-error-callback-page-nextjs/188880 "2025-07-08T09:34:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![josh14](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/josh14/32/59823_2.png) [@josh14](https://community.auth0.com/u/josh14)\
**Post date:** [July 8, 2025, 9:34am UTC](https://community.auth0.com/t/customise-error-callback-page-nextjs/188880/1 "2025-07-08T09:34:01Z")

</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 change was made with auto-generation of routes.

---

<div class="post-metadata">

**Author:** ![josh14](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/josh14/32/59823_2.png) [@josh14](https://community.auth0.com/u/josh14)\
**Post date:** [July 8, 2025, 9:35am UTC](https://community.auth0.com/t/customise-error-callback-page-nextjs/188880/2 "2025-07-08T09:35:22Z")

</div>

PS: The community rules here seem a bit ridiculous, I can’t include a link and I can’t include an image. How am I supposed to provide context and details?

---

<div class="post-metadata">

**Author:** ![nik.baleca](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/nik.baleca/32/68749_2.png) [@nik.baleca](https://community.auth0.com/u/nik.baleca)\
**Post date:** [July 9, 2025, 7:24pm UTC](https://community.auth0.com/t/customise-error-callback-page-nextjs/188880/4 "2025-07-09T19:24:37Z")

</div>

Hi @josh14

Welcome to the Auth0 Community!

I am sorry that you are unable to post links or images directly on the community page, however, regarding your issue, I believe that inside the `Auth0Client` instance you define in the v4 route, you can add a `onCallback` parameter, which runs a hook once after authentication.

There you can retreive the session and token and allows you to define post login functionality which is useful. You can visit our [Github documentation](https://github.com/auth0/nextjs-auth0/tree/main?tab=readme-ov-file#customizing-the-client) regarding customizing the client.

If you have any other questions, let me know!

Kind Regards,  
Nik

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/auth0/original/3X/b/5/b560f266932fcce5d57f09a6595bd50518cae3f3.jpeg) [@system](https://community.auth0.com/u/system)\
**Post date:** [July 23, 2025, 7:24pm UTC](https://community.auth0.com/t/customise-error-callback-page-nextjs/188880/5 "2025-07-23T19:24:47Z")

</div>

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.
