react-serverless-auth

1.5.0 • Public • Published

React Authentication Components using AWS Cognito

Build Status Coverage Status dependencies Status npm version Maintainability Test Coverage

Try react-serverless-auth on CodeSandbox

Installation

$ yarn add react-serverless-auth
or
$ npm install --save react-serverless-auth

Configuration

To simplify the integration with create-react-app the package uses environment variables as described in the create-react-app documentation. The environment variables are handled using dotenv by default.

Amazon Cognito User Pool

To use the react-serverless-auth components you need to create an Amazon Cognito User Pool from the AWS Console for Cognito User Pools or using the create-user-pool command in the AWS CLI.

IMPORTANT: When creating the App, the generate client secret box must be unchecked because the JavaScript SDK doesn't support apps that have a client secret.

The User Pool ID and Client ID are specified in the following environment variables:

REACT_APP_COGNITO_USER_POOL_ID
REACT_APP_COGNITO_CLIENT_ID

Authentication URLs

The authentication endpoint URLs are configurable and the following default values are pre-defined in src/routes.js:

REACT_APP_AUTH_LOGIN_URL=/auth/login
REACT_APP_AUTH_CONFIRM_URL=/auth/confirm
REACT_APP_AUTH_REGISTER_URL=/auth/register
REACT_APP_AUTH_RESET_URL=/auth/reset

Contributing

See CONTRIBUTING.md.

Technology Stack

Dependencies

Package Sidebar

Install

npm i react-serverless-auth

Weekly Downloads

11

Version

1.5.0

License

MIT

Unpacked Size

13.2 MB

Total Files

68

Last publish

Collaborators

  • stanchino