If possible, you might be able to get away with using middleware depending on if you are using JWT sessions, I was just using normal database sessions. You can also setup a route guard directly in your client only react code if you want by using the useSession hook and a useEffect, but I decided to go with this approach.
------------
🤑 Patreon [ Ссылка ]
🔔 Newsletter [ Ссылка ]
💬 Discord [ Ссылка ]
📁. GitHub [ Ссылка ]
![](https://i.ytimg.com/vi/VP-RCddbjrc/maxresdefault.jpg)