3.0.0 • Published 6 years ago

@source4society/react-authapp-container v3.0.0

Weekly downloads
-
License
AGPL-3.0
Repository
github
Last release
6 years ago

react-authapp-container

A boilerplate app container that contains authentication sagas (react-boilerplate/react-native)

scepter-logo

redux-logo

react-boilerplate

airbnb-codestyle

Build Status

codecov

Installation

Using npm

npm install @source4society/react-authapp-container

Using yarn

yarn add @source4society/react-authapp-container

Setup

This container is intended to be used with SCEPTER-webui which is a modified fork of react-boilerplate or SCEPTER-mobileui based off of React Native.

Example

Include this container in your base app container, and pass it a Shell and LoadingIndicator component as follows:

<App shellComponent={Shell} loadingIndicatorComponent={LoadingIndicator} />

You can also pass custom props, which will be passed to the shell component as appProps

The shell will receive the following props from the App container:

isAuthenticated userRoles userId username expires jwt appProps

Please see the action.js, reducer.js, selectors.js and saga.js files for an understanding of how to manipulate the value of these properties.

React Native

For React Native applications, you must set localStorage to be the AsyncsStorage object on the global scope before mounting this container. You can replace localStorage with another storage implementation of choice so long as the interface is similar.