Skip to content

I have developed private routing system using Higher Order Component (HOC) in Next JS. This project has a Home page, Login page, and, a dashboard. Dashboard is under private route and in order to access dashboard page user have to login first.

License

Notifications You must be signed in to change notification settings

musiur/hoc-private-route-next-js

Repository files navigation

hoc-private-route-next-js Assalamo alaikum.... Here I gonna show you how to use HOC(Higher Order Component) to make a private route in Next JS. But you can use this also in React. What I have done? 1. I used a js file where I have written some functions which will help us to get, set, delete, delete all the cookies in browser cookies. 2. I made a HOC function to authenticate any component which will be in the private route. 3. A home page with a basic design, we will see. From there We can go to the dashboard if the user signed in. 4. A navbar will be used to navigate the Dashboard page, homepage, login page, or logout. Here is the repository link: https://github.com/MusiurAlamOpu/hoc-private-route-next-js Demo Site link: https://hoc-private-route-next-js.vercel.app/ If you want to know further or facing any problem regarding implementation...let me know via my email musiuralamo@gmail.com Zajakallahu khayer.# hoc-private-route-next-js # hoc-private-route-next-js

About

I have developed private routing system using Higher Order Component (HOC) in Next JS. This project has a Home page, Login page, and, a dashboard. Dashboard is under private route and in order to access dashboard page user have to login first.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published