DEV Community

Discussion on: Protected Routes with Supabase and Next.js

Collapse
 
sruhleder profile image
Sebastian Ruhleder

Hi! 👋

getStaticProps is evaluated at build time, so it's for static content. getServerSideProps is evaluated every time the page is loaded, so it's for dynamic content.

Here's a good introduction on data fetching from the Next.js docs. I also found this video particularly helpful when I started out with Next.js.

Collapse
 
shar51 profile image
A. Ashar

Thanks,

I would definitely check out the video.

Thread Thread
 
sannajammeh profile image
Sanna Jammeh

NextJS edge middleware gives you this functionality. All authorization happens in the middleware and your page static renders as usual with getStaticProps. The middleware can prevent access to the static page.