basir / next-amazona

next-amazona.vercel.app
289 stars 226 forks source link

Server Side Route Protection #1

Open alpha-titan opened 3 years ago

alpha-titan commented 3 years ago

We get a glimpse of the UI with client side route protection, but with validation in server side and checking if the user is authenticated it will only render page which unauthenticated people will see if they are not authenticated, getServerSideProps can block all the operations till the render is complete, therefore this will not have any flashes of authenticated UI,

use case: prime benifits: with only client side route protection the pre-rendering will give a glimpse of the prime UI with server side authentication it is guaranteed to show the un authenticated UI