Heads up! To view this whole video, sign in with your Courses account or enroll in your free 7-day trial. Sign In Enroll
Well done!
You have completed React Authentication!
You have completed React Authentication!
Preview
In this step, you will use React Router to control what users can and cannot view in your application based on their identity.
Resources
Treehouse Courses and Workshops
Related Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign upRelated Discussions
Have questions about this video? Start a discussion with the community and Treehouse staff.
Sign up
This is likely not what you or
your users would expect.
0:00
The route should be private
to authenticated users only.
0:02
To fix this, we'll create a component
that will act as a gatekeeper for
0:06
the authenticated and settings routes.
0:11
Depending on if the user is authenticated
or not, the component will either allow
0:13
the user to continue to the PrivateRoute
or redirect them to the Sign in page.
0:19
We'll start off by creating a new
file in the components folder and
0:25
You need to sign up for Treehouse in order to download course files.
Sign upYou need to sign up for Treehouse in order to set up Workspace
Sign up