Customise error callback page (NextJS)

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.

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?

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 regarding customizing the client.

If you have any other questions, let me know!

Kind Regards,
Nik