@adamldoyle/react-aws-auth-context-mui-rhf 中文文档教程

发布于 3年前 浏览 2 项目主页 更新于 3年前

react-aws-auth-context-mui-rhf

使用 AWS 管理身份验证流程的 React 上下文。 它的实现非常固执己见,因为主要目标是为我的 React 应用程序提供一个快速使用的身份验证解决方案。 利用 AWS(通过 aws-amplify)、Material-UI、react-hook-form(是的模式)和 react-toastify。

Usage

  1. yarn add @adamldoyle/react-aws-auth-context-core @adamldoyle/react-aws-auth-context-mui-rhf
  2. Configure aws-amplify Auth prior to mounting <AuthContextProvider> (example provided in ./storybook/preview.js)
  3. Requires Cognito to be configured with:
  • email as username
  • givenname, familyname, and allow_marketing attributes (none marked as required)
  1. Wrap portion of app that requires authentication in <AuthContextProvider> (normal usage would be to wrap entire app near the top-level)

Examples

Context/AuthContextProvider story 通过 Storybook

  • https://adamldoyle-react-aws-auth-context-mui-rhf-storybook.netlify.app/

  1. Create .env file in root based on .env.sample
  2. yarn storybook

Development

  1. yarn install
  2. yarn build

Contributors

Adam Doyle

License

MIT提供了完整的流程示例

react-aws-auth-context-mui-rhf

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, react-hook-form (Yup schemas), and react-toastify.

Usage

  1. yarn add @adamldoyle/react-aws-auth-context-core @adamldoyle/react-aws-auth-context-mui-rhf
  2. Configure aws-amplify Auth prior to mounting <AuthContextProvider> (example provided in ./storybook/preview.js)
  3. Requires Cognito to be configured with:
  • email as username
  • givenname, familyname, and allow_marketing attributes (none marked as required)
  1. 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-mui-rhf-storybook.netlify.app/

OR

  1. Create .env file in root based on .env.sample
  2. yarn storybook

Development

  1. yarn install
  2. yarn build

Contributors

Adam Doyle

License

MIT

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文