We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I try to process error when initialize auth0, but the an error is show instead of redirect to error page
In file lib/auth0.ts, add
import { Auth0Client } from '@auth0/nextjs-auth0/server' import { NextResponse } from 'next/server' export const auth0 = new Auth0Client({ authorizationParameters: { audience: process.env.AUTH0_AUDIENCE, scope: 'asd' }, async onCallback(error, context, session) { // redirect the user to a custom error page if (error) { return NextResponse.redirect( new URL(`/error?error=${error.message}`, process.env.APP_BASE_URL) ) } // complete the redirect to the provided returnTo URL return NextResponse.redirect( new URL(context.returnTo || '/', process.env.APP_BASE_URL) ) } })
It will not redirect to error page, but show an error window
No response
4.1
15.1.7
22.14.0
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Checklist
Description
I try to process error when initialize auth0, but the an error is show instead of redirect to error page
Reproduction
In file lib/auth0.ts, add
It will not redirect to error page, but show an error window
Additional context
No response
nextjs-auth0 version
4.1
Next.js version
15.1.7
Node.js version
22.14.0
The text was updated successfully, but these errors were encountered: