import { handleAuth, handleCallback, handleLogin } from '@auth0/nextjs-auth0'
import { NextApiRequest, NextApiResponse } from 'next'
export default handleAuth({
login: async (req: NextApiRequest, res: NextApiResponse<any>) => {
const authParams = {
audience: process.env.AUTH0_AUDIENCE,
}
try {
await handleLogin(req, res, {
authorizationParams: {
...authParams,
},
returnTo: '/app'
})
} catch (error: any) {
res.json(error)
res.status(500).end()
}
},
})
Here is my auth code, I am not sure what I am doing wrong