using auth, how can i make it so that the user needs to login to access certain pages?
using react router btw
3 Replies
If it is authenticated then show this page1 or else page2.
Write a condition.
There are two ways to check the authentication
1. Use getSessio() to know whether the user is authenticated
2. You can check the token also
ah so a basic conditional on either 1 or 2?
ok thank you ill try that in a bit
Yes
React Router I haven't tried but logic is same