Skip to content

Use getServerSideProps in index page to redirect to dashboard

Jared Pereira requested to merge getServerSideProps into master

If the user is logged in we want to redirect to the dashboard without a flash on the homepage first. We can use the getServerSideProps function to do so.

It might be better (marginally) to introduce a specific route like /landing and redirect there if not logged in, so that that page can be statically generated, and all the index route does is decide where to route people.

Alternatively, we could just make the index route also render the dashboard by passing it the relevant props...

Merge request reports