Auth0 w/ NextJS and Vercel Not Working

I’m trying to use Auth0 with Next.js for the first time, and I just can’t seem to make it work. I’ve tried using the auth0-react package and now I’m trying the nextjs-auth0 package.

I get a 500 error any time I try using the /api/auth/login route.

Here are the relevant pages of my repo

I also created an .env.local, but for obvious reasons it’s in the .gitignore

It should be noted that the App Settings in the auth0 website won’t let me use localhost for any of the allowed urls since it’s not https. Idk what to do about that, but it could be the reason it’s not working. I tried making it work with my Vercel deployment instead, but that doesn’t work either.

If anybody knows what I’m doing wrong, please let me know.

When I say localhost, I mean something like http://localhost:3000/

Tried to put that in the original post, but there’s a link limit.

I realized I need to be using the Regular Application Type but changing that and updating my env didn’t work

Okay, for whatever reason, copying and pasting the example env file worked. I must’ve had a typo or something. I’m good to go.

Hey team!

This topic seems related to the new Auth0 Integration available new in Vercel Marketplace. This is the first version of this integration, and we welcome your feedback to improve future iterations.

You’ll need an existing Vercel project to use the new integration to build and customize the Identity flow. You can either import your project into Vercel or use a Vercel template so you don’t have to start from scratch like our SaaStart template to deploy a production-ready B2B SaaS app in minutes (learn more here).

If you find yourself having questions regarding this new integration for the next two weeks, we are hosting an Ask Me Anything session. Our Product Expert will provide comprehensive written answers on August 8th from 8 AM to 10 AM PST.

Find out more about Auth0 Integration and learn more about AMA.

Thanks!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.