I have implemented authO in my Next13 app project. My login returns to root location now i want it to dynamic after success redirection currently i have this code in my route.js
import { handleAuth, handleLogin } from "@auth0/nextjs-auth0";
export const GET = handleAuth({
login: handleLogin({
authorizationParams: {
prompt: "login",
},
returnTo: "/",
}),
signup: handleLogin({
authorizationParams: {
prompt: "login",
screen_hint: "signup",
},
returnTo: "/", // This is the default behavior
}),
loginFromProduct: handleLogin({
authorizationParams: {
prompt: "login",
},
returnTo: "/product-detail-2?id=1b2fec2c-d5f0-4ae9-a48b-67479f9b6ebb",
}),
});
loginFromProduct should redirect back to the same product page currently i hardcoded it how can i make it dynamic i have the ids of product from where login button is activating