From the course: Firebase Essential Training

Unlock the full course today

Join today to access over 24,700 courses taught by industry experts.

Add private routes

Add private routes

- [Instructor] Okay, so we've got all the functions we need in place to actually add authentication to our app. The next step we're going to take here is changing our app just a little bit so that only authenticated users can visit certain pages. If we open up our app.js file, which contains all of the routes for our application, we see that we have all of these routes defined so that the correct page renders when we go to a given URL in our browser. And don't worry if you're not really familiar with react-router-dom, which is the package we're using here, it's just the main way of doing routing related logic in React applications. Now, what we want here is for some of these routes, pretty much all of them besides the sign-in, create account, and email confirmation routes, we want these to be accessible only to authenticated users. And this isn't so much out of security as out of the fact that it just wouldn't really…

Contents