Connecting the login functionality with the API

In this section, we are going to work on login functionality. The REST API code we have included in the code base provides an endpoint, /api/users/signin, for authentication purposes. In Chapter 5React with Redux, we created actions that are dispatched when the user tries to log in with these credentials. In this section, we will listen to the login action, validate the credentials with our database, and redirect the user to a dashboard with a list of users if their credentials are correct or throw an error if the credentials are not correct. The process can be visualized in a sequence diagram, Figure 6.2:

Figure 6.2: Sequence diagram of the user authentication system
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset