From the course: React: Authentication

Unlock the full course today

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

Converting the verify email route

Converting the verify email route - React.js Tutorial

From the course: React: Authentication

Converting the verify email route

- [Instructor] All right, we have our page where the user can enter the verification code that Cognito will send them. So, the next thing we're going to do is create a server route that the user can actually send that code to in order to prove to Cognito that they own the email address. So here's what that's going to look like. Let's open up the verify email route, and we're going to make a few key changes to this route and it's handler. So, first of all, up at the top here, what we're going to do is import something called CognitoUser from Amazon Cognito Identity JS and down here at the bottom, we're going to import the awsUserPool thing that we created earlier. All right, so we're going to import that from util slash awsUserPool. Okay, and now that we have those things, we're going to go through the routes handler and make a few changes to make this route use Cognito instead of our own homemade logic.…

Contents