Securing a website route / component
You may want to prevent rendering of some part of UI, or a route, when there's no session.
- ReactJS
- Plain JavaScript
- React Native
To achieve that, wrap the component tree in ThirdPartyEmailPasswordAuth
. When there's no session, this component will redirect the user to the login page.
Do you use react-router-dom?
YesNo
You will need to manually check if a session exists and redirect the user to the login page if not.
You will need to manually check if a session exists and redirect the user to the login screen if not.