Too Long; Didn't Read
A React HOC for AWS Cognito to Simplify User Authentication is a very common one across apps and platforms. Amazon Web Services offers Cognito as a solution for Web and Mobile apps, and it has pretty robust features to handle your Authentication needs. Here we describe a Higher Order Component for your ReactJS Web App, and how to configure Cognito. You can use any backend that is secured through JWT Tokens (e.g., API Gateway, etc.) When a user logs in, tokens will be provided to the client using our configured storage mechanism (in-memory, localStorage, or IndexedDB) After that, cognito-hoc handles all authentication flows using Cognito and AWS Amplify.