我目前正在使用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/>
或通过其他方式从标准注册流程中禁用此功能?
谢谢。
您可以在Cognito面板中禁用验证。