Current section: Protecting Routes 6 exercises

Creating Protected Routes

Loading exercise


00:00 So, I'm logged in, it wouldn't make a lot of sense for me to go to login. Even though we don't have any links there, it'd be confusing. I've used apps that will allow you to go to the login screen even when you're logged in, and sometimes they accidentally navigate you there in some ways, and it's really annoying. I don't like that.

00:19 It's very confusing. So, the login page, probably not somewhere I should be able to go, as well as the onboarding page, the signup page. I shouldn't be able to go there either when I'm logged in. So, we're going to start doing protected routes, but we're going to start with the unauthenticated routes. I should go back to the homepage if I end up on one of these routes.

00:39 So that is your task. Make sure that if I'm logged in, send me to the homepage, and we're going to have you build a utility to make this easy. So, have at it and have a good time.