AWS Amplify Auth:如何禁用AmplifyConfirmSignUp?

问题描述 投票:0回答:1

我目前正在使用AWS Amplify auth,并使用Cognito进行React身份验证。用户注册必须通过单击通过电子邮件收到的确认链接来确认其新帐户。

[当提交他们的注册信息时,下一个显示的UI是确认注册,要求用户确认代码。我不需要这个阶段,因为这是在用户确认电子邮件后处理的。

我正在使用react-ui Amplify组件来控制身份验证和用户注册/签入/签出。

import React from "react";
import "./App.css";
import { BrowserRouter as Router } from "react-router-dom";
import "bootstrap/dist/css/bootstrap.min.css";
import { Container } from "react-bootstrap";
import NavBar from "./components/NavBar.js";

import {
  AmplifyAuthenticator,
  AmplifySignUp,
  AmplifyConfirmSignUp,
  AmplifySignOut,
} from "@aws-amplify/ui-react";

import RouteContainer from "./components/RouteContainer";

function App() {
  return (
    <div>
      <AmplifyAuthenticator usernameAlias="email">
        <AmplifySignUp
          slot="sign-up"
          usernameAlias="email"
          formFields={[
            {
              type: "email",
              label: "Enter your email",
              placeholder: "Enter your email",
              required: true,
            },
            {
              type: "password",
              label: "Enter your password",
              placeholder: "",
              required: true,
            },
            {
              type: "custom:postcode",
              label: "Enter your postcode",
              placeholder: "",
              required: true,
            },
          ]}
        >
          <AmplifyConfirmSignUp/>

        </AmplifySignUp>
        <AmplifySignOut />
        <Router>
          <Container>
            <RouteContainer />
          </Container>
        </Router>
        <NavBar />
      </AmplifyAuthenticator>
    </div>
  );
}

export default App;

是否有我可以通过的道具来禁用<AmplifyConfirmSignUp/>或通过其他方式从标准注册流程中禁用此功能?

谢谢。

reactjs amazon-web-services components amazon-cognito aws-amplify
1个回答
0
投票

您可以在Cognito面板中禁用验证。

  1. 转到https://console.aws.amazon.com/cognito/
  2. 单击“管理用户池”
  3. 在“常规设置”中,单击“ MFA和验证”
  4. 在“您要验证哪些属性?”下选择“不验证”
© www.soinside.com 2019 - 2024. All rights reserved.