From the course: AWS and React: Creating Full-Stack Apps (2019)

Unlock the full course today

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

Adding user auth to a React app

Adding user auth to a React app - Amazon Web Services (AWS) Tutorial

From the course: AWS and React: Creating Full-Stack Apps (2019)

Start my 1-month free trial

Adding user auth to a React app

- [Narrator] So we laid the ground work for everything we need for user authentication. Now we just need to add it to our app. We can pretty easily do that in the code. So I'm going to go back to the terminal and in my project directory, I'm going to open the source file, src/App.js. And all we have to do is import a handful of things and use them to add authentication. So the first thing I'm going to import is import, on line four, auth from 'aws-amplify'; and then I'm also going to import the configuration, so on line five, import awsconfig from './aws-exports'; And then also I'm going to import on line six, import{ withAuthenticator } from 'aws-amplify-react'; and then we're going to use the configuration on the auth. So on line seven I'll type, Auth.configure and pass in the (awsconfig); so that takes care of all the things that we need to pull in. The other thing we need to do is on line 30 we need to change…

Contents