Reputation: 2928
I'm working on an application built with amplify and react. I have an auth module.
I want basically to have only one user, I don't want to let peoples create accounts.
My question is how to hide the sign up option ?
Thanks.
C.C.
Upvotes: 2
Views: 3139
Reputation: 1651
Disable signup in the backend
const { cfnUserPool } = backend.auth.resources.cfnResources
cfnUserPool.adminCreateUserConfig = {
// disables self sign-up for non-federated users
allowAdminCreateUserOnly: true,
}
Upvotes: 0
Reputation: 1863
In case someone is still looking into this, and you're using:
import {Authenticator} from "@aws-amplify/ui-react";
The solution is to pass the flag to the Authenticator
component directly, as per the official documentation:
<Authenticator hideSignUp={true}>
Upvotes: 1
Reputation: 949
In App.css
, or whatever appropriate style sheet, put
.amplify-tabs {
display: none;
}
but make absolutely sure that it is imported after @aws-amplify/ui-react/styles.css
.
I don't use style sheets, preferring inline styling, but this solution was so elegant I am making an exception!
Upvotes: 2
Reputation: 732
You can use the hideSignUp
property:
<AmplifyAuthenticator>
<AmplifySignIn slot="sign-in" hideSignUp></AmplifySignIn>
</AmplifyAuthenticator>
Upvotes: 3