I want to redirect user to a dynamic route in nextJs after the user athenticated i don’t from where it should be done like using api route or middleware.
here in “returnTo” i want the user to redirect to “/organization/[orgId]”.
Blockquote
// app/api/auth/[auth0]/route.js
import { handleAuth, handleLogin, handleLogout } from “@auth0/nextjs-auth0”;
For scenarios where dynamic callbacks are desired, we suggest providing one callback URL for all those /organization/[orgId] URLs and leveraging the state parameter during authentication.