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