Adding protected routes in Next (Next-Auth and getServerSideProps)

Channel:
Subscribers:
254,000
Published on ● Video Link: https://www.youtube.com/watch?v=VP-RCddbjrc



Duration: 7:49
28,104 views
523


If possible, you might be able to get away with using middleware depending on if you are using JWT sessions, I was just using normal database sessions. You can also setup a route guard directly in your client only react code if you want by using the useSession hook and a useEffect, but I decided to go with this approach.

------------

🤑 Patreon https://www.patreon.com/webdevjunkie
🔔 Newsletter http://eepurl.com/hnderP
💬 Discord https://discord.gg/4kGbBaa
📁. GitHub https://github.com/codyseibert/youtube







Tags:
web development
programming
coding
code
learn to code
tutorial
software engineering
next
next.js
next-auth
sessions
authentication
route guard
protected routes