using auth, how can i make it so that the user needs to login to access certain pages?

using react router btw
3 Replies
thatsbro
thatsbro3y ago
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
bennypc
bennypcOP3y ago
ah so a basic conditional on either 1 or 2? ok thank you ill try that in a bit
thatsbro
thatsbro3y ago
Yes React Router I haven't tried but logic is same

Did you find this page helpful?