I am using the handleAuth function, using the App router, and want to pass a dynamic email address to the handleLogin function. I can pass a predefined email using the login_hint
param and have tested this with a hard-coded email const.
import { handleAuth, handleLogin, handleLogout } from '@auth0/nextjs-auth0';
const email = 'john@test.com'
export const GET = handleAuth({
logout: handleLogout({ returnTo: '/login' }),
login: handleLogin({ authorizationParams: { login_hint: email }, returnTo: '/profile' }),
});
I now need to retrieve the query parameter from the API URL so that I can pass in dynamic emails; however, I can’t figure out the syntax to get the query parameters.
Does anyone know how to get the request object within the handleAuth function?