From the course: React: Securing Applications

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Finalize menu with login

Finalize menu with login - React.js Tutorial

From the course: React: Securing Applications

Start my 1-month free trial

Finalize menu with login

- [Instructor] Okay, so the last thing that we need to do is update the navigation inside of our application, so we can actually log in and log out of our application. So let's go ahead and go into the Navigation file right here. So the first thing we're going to need to do is import a few things. So let's go ahead and import the special file that we have in here inside of that particular file here. So let's go ahead and do that. So I'm going to useAuth0 from react-auth0-spa, like so. And then what we'll do is start coding a few elements inside of our component. So let's go ahead and first use what we just imported, and I'm going to first open and close my curly braces, and then useAuth0, and this is a function, and then inside of our curly braces, I will deconstruct what I need. So the first one that I need is isAuthenticated. The second one is loginWithRedirect. And finally, logout. Once I have these, I'm able…

Contents