Use this to store additional state for the user before they visit the identity provider to log in.
// app/api/auth/[auth0]/route.jsimport { handleAuth, handleLogin } from '@auth0/nextjs-auth0';const getLoginState = (req, loginOptions) => { return { basket_id: getBasketId(req) };};export default handleAuth({ login: handleLogin({ getLoginState })}); Copy
// app/api/auth/[auth0]/route.jsimport { handleAuth, handleLogin } from '@auth0/nextjs-auth0';const getLoginState = (req, loginOptions) => { return { basket_id: getBasketId(req) };};export default handleAuth({ login: handleLogin({ getLoginState })});
Use this to store additional state for the user before they visit the identity provider to log in.