Connecting the home page with the API

Whenever any user opens our application, the initial request is to see if the user is authenticated or not. This can be done by storing logged-in users in cookies or local storage for a certain amount of time and then checking if the token is valid. Well, developers might ask "Why cookies and not local storage?" While we agree that local storage is better and is used more often, we wanted to keep the hands-on as simple as possible. Our goal is to show the logged in user in the header bar and show the list of users, as shown in the screenshot:

Figure 6.4: Dashboard page for logged in user

To achieve this, ...

Get Redux Quick Start Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.