"Ruby Foundations" was retired on September 23, 2015. You are now viewing the recommended replacement.
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
Congrats, you’ve built a robust client authentication feature!
Resources
- useContext - React
- <Navigate> - React Router
- <Outlet> - React Router
- <Route> - React Router
- useLocation - React Router
- Navigate props - React Router
- js-cookie
- Basic usage for a cookie
- Expire a cookie
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
You created the PrivateRoute component
that either allows the user to
0:00
access the private route or
redirects them depending on whether or
0:02
not the user is logged in.
0:06
You then learn about React Router's
useLocation hook, and
0:08
how it can be used to make
the sign-in redirect smarter.
0:12
Now, whenever the PrivateRoute
component redirects the user to sign in,
0:16
they will be redirected back to
the original site after signing in.
0:21
Next, you learn how to use
cookies to store data.
0:26
First, how to store the authenticated
user data, so that the user wouldn't
0:29
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