1. 9
    Add Authentication to a Next.js Application with Auth0
    5m 10s

Add Authentication to a Next.js Application with Auth0

InstructorShadid Haque

Share this video with your friends

Send Tweet

We'll use Auth0's Next.js quickstart guide to add authentication to our application. While doing so, we'll create and set all the right keys that we will need, create an auth api route, wrap our application in a UserProvider component and finally add a login button that uses Auth0's hook they provide.

Jason
~ 2 years ago

Too many issues with Fauna. Getting "Server Error TypeError: Cannot read properties of undefined (reading 'getAllProducts')" most times and then restart and works. :-/

Shadid Haqueinstructor
~ 2 years ago

Ahh when you change the environment variables in Next.js you have to restart the server. Sorry should have explicitly mentioned that.

Jason
~ 2 years ago

Still don't not work. No matter what I try I can't get past the same error. I have the Apollo dev tools installed and can run the same query and get results. Unfortunately I cannot send the screen shot but it seems like some caching issue.

Shadid Haqueinstructor
~ 2 years ago

Hey Jason, would you be able to share your code via GitHub. I can take a look

Jason
~ 2 years ago

Sure, I just added it here minus the .env.local but I can send it without values if you need it. https://github.com/contd/marketplace-app Thanks!

Jason
~ 2 years ago

I figured it out! I forgot to set the AUTH0_SECRET in .env.local which probably messed things up. Once I got it set and started over it all worked!

Shadid Haqueinstructor
~ 2 years ago

Awesome, let me know if you need help with anything else. You can also reach out on twitter @HaqueShadid.