I built this repo when I was just playing around with Auth0 and NextJS. Now that I'm working at Auth0 for almost 2 years, I can say that it is the wrong approach to use. Auth0 will be releasing guidance on this in the near future, but the short explanation is:
- Create a custom server handler
- Follow our guidance on how to secure NodeJS server apps
- Profit 💰