My fav place to learn to code is Scrimba
Get 20% off a subscription with my link 👇
https://scrimba.com/?via=brettwestwood
This is part 4 of a 4-part video series about how to set up Auth.js v5 on a Next.js project.
In this video, we will go over how to set up middleware so you can protect certain routes and make others publicly accessible.
I also go over how to avoid issues when it comes to dealing with the edge environment.
If you enjoyed this video then I would appreciate it, if you can hit the like button and also subscribe. Thanks!
GitHub Repo 👇
https://github.com/bwestwood11/auth-v...
Time Stamps
0:00 Intro
0:36 Set up middleware.ts file
1:02 Go over Auth.js middleware example
2:15 Add the config object in middleware
3:39 Access the pathname and if the user is logged in or not
5:52 Define private routes
6:42 Coding the logic for the middleware function
15:27 Outro