DEV Community

Discussion on: Implement Protected Routes in NextJS

Collapse
 
ya7mo profile image
Yahya Aloyoni.

Thanks a lot for this post its very helpful.
i am facing an issue when wrapping my page withAuth, it loads the page then redirects to "/" or whatever my fallback is, is there a way to prevent that from happening.

Collapse
 
shubhamverma profile image
Shubham Verma

You could try removing the Router.replace("/"), by returning some JSX like "Verifyiing" or something