DEV Community

Discussion on: Implement Protected Routes in NextJS

Collapse
 
minhhunghuynh1106 profile image
igdev

If u using getServerSideProps, when you view page source then it not have any content, not friendly SEO 😥 Can u fix that?

Collapse
 
eurowhisper profile image
EuroWhisper

Hello, in case of it not working with getServerSideProps, I believe it doesn't matter. Because search engines can't crawl protected routes anyway (the search engine doesn't have a username/password for your application). Basically, any page you need to pass a login screen in order to view won't be crawled by a search engine spider anyway. In other words, don't wrap any publicly viewable (and therefore search engine crawlable) pages with WithAuth() in order to avoid trouble with SEO. :)