在放大反应应用程序中隐藏注册

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

我正在开发一个使用 amplify 和 React 构建的应用程序。 我有一个身份验证模块。

我基本上只想拥有一个用户,我不想让人们创建帐户。

我的问题是如何隐藏注册选项?

谢谢。

C.C.

reactjs aws-amplify
3个回答
3
投票

您可以使用

hideSignUp
属性

<AmplifyAuthenticator>
  <AmplifySignIn slot="sign-in" hideSignUp></AmplifySignIn>
</AmplifyAuthenticator>

2
投票

App.css
或任何适当的样式表中,放置

.amplify-tabs {
  display: none;
}

但绝对确保它是在

@aws-amplify/ui-react/styles.css
之后导入的。

我不使用样式表,更喜欢内联样式,但这个解决方案非常优雅,我破例了!

https://ui.docs.amplify.aws/react/connected-components/authenticator/customization#additional-css-styling


0
投票

如果有人仍在研究此问题,而您正在使用:

import {Authenticator} from "@aws-amplify/ui-react";

解决方案是直接将标志传递给

Authenticator
组件,按照官方文档

<Authenticator hideSignUp={true}>
© www.soinside.com 2019 - 2024. All rights reserved.