Amplify-js: Hide Create Account section inside SignIn components

Created on 14 May 2020  路  5Comments  路  Source: aws-amplify/amplify-js

Is your feature request related to a problem? Please describe.
In cognito it is possible to prevent users to autonomously create accounts: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cognito-userpool-admincreateuserconfig.html#cfn-cognito-userpool-admincreateuserconfig-allowadmincreateuseronly

When rendering my SignIn component, there is a link that I can't remove: No account? Create account. When using the new web components, I can't seem to find a clean way to hide the element via CSS either. Obviously when a customer clicks, a sign up form is actually rendered, and obviously account creation fails because of the Cognito enforced policy.

Describe the solution you'd like
Having a parameter in the signin component to hide the create section would allow all the flexibility I need.

Describe alternatives you've considered
Hacking around CSS. With web components it's not Nice!

Additional context
I'm making a PR so in case we can discuss the how in front of the code.

feature-request

Most helpful comment

Glad that worked! I will definitely make a note to add this to our documentation as this seems like a relatively common use case.

I'd say we can probably close both this issue and the PR for now. I will also create a new feature request so we can track the feature of providing the authenticator component with better user pool context, then link this issue there.

Thank you for spinning up that PR, really appreciate your contribution.

All 5 comments

This is possible using slots: https://github.com/aws-amplify/amplify-js/issues/5594

We are working on providing the component more context of the user pool configuration to populate the forms appropriately.

Fantastic! I just tested and it works great. I'm happy for you to close both the issue and PR, but if you think I can help to remodel the PR to make it context sensitive rather than param driven, happy to try having a go?

Glad that worked! I will definitely make a note to add this to our documentation as this seems like a relatively common use case.

I'd say we can probably close both this issue and the PR for now. I will also create a new feature request so we can track the feature of providing the authenticator component with better user pool context, then link this issue there.

Thank you for spinning up that PR, really appreciate your contribution.

no problem, always happy to help.

how to hide create account button , please suggest , thanks in advance
isSignUpDisplayed: false is notworking when passing in object
withAuthenticator(App, false, [], null, null, {
isSignUpDisplayed: false,
})}

Was this page helpful?
0 / 5 - 0 ratings