@adamldoyle/react-aws-auth-context
v1.3.2
Published
React context for managing authentication flow with AWS. Extremely opinionated in its implementation as the primary goal is to provide a quick-to-use authentication solution for my React apps. Utilizes AWS (via aws-amplify), Material-UI, Formik (Yup schem
Downloads
34
Readme
react-aws-auth-context
React context for managing authentication flow with AWS. Extremely opinionated in its implementation as the primary goal is to provide a quick-to-use authentication solution for my React apps. Utilizes AWS (via aws-amplify), Material-UI, Formik (Yup schemas), and react-toastify.
Usage
yarn add @adamldoyle/react-aws-auth-context
- Configure aws-amplify Auth prior to mounting
<AuthContextProvider>
(example provided in./storybook/preview.js
) - Requires Cognito to be configured with:
- email as username
- given_name, family_name, and allow_marketing attributes (none marked as required)
- Wrap portion of app that requires authentication in
<AuthContextProvider>
(normal usage would be to wrap entire app near the top-level)
Examples
Full flow example is provided in the Context/AuthContextProvider
story via Storybook
- https://adamldoyle-react-aws-auth-context-storybook.netlify.app/
OR
- Create
.env
file in root based on.env.sample
yarn storybook
Development
yarn install
yarn build
Contributors
License
MIT