Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

Add "Sign Up" method #721

Open
hoIIer opened this issue Apr 1, 2022 · 5 comments
Open

Add "Sign Up" method #721

hoIIer opened this issue Apr 1, 2022 · 5 comments

Comments

@hoIIer
Copy link

hoIIer commented Apr 1, 2022

Hello, I'm investigating this as a replacement for ember-cognito due to a blocking bug brought about by reliance on @aws-amplify.

The only thing stopping me is that this library is missing a signup method. Is there a reason for that? Can we add it?

If we can add that I think this is a great replacement for ember-cognito.

At first I was going to suggest making this compatible with ember-simple-auth, but I'm not sure it's even necessary and I like the idea of thin packages.

Thanks!

@hoIIer
Copy link
Author

hoIIer commented Apr 1, 2022

cognito.userPool.signUp() exists but when I tried using it I got a serialization error from aws... will look into it further.

@hoIIer
Copy link
Author

hoIIer commented Apr 2, 2022

Was able to get it working via below:

import AmazonCognitoIdentity from 'amazon-cognito-identity-js';

        ...

        const attributes = [
          new AmazonCognitoIdentity.CognitoUserAttribute({
            Name: 'email',
            Value: email,
          }),
          new AmazonCognitoIdentity.CognitoUserAttribute({
            Name: 'custom:foo',
            Value: 'bar',
          }),
        ];

        await this.cognito.userPool.signUp(
          email,
          password,
          attributes,
        );

@mydea
Copy link
Contributor

mydea commented Apr 4, 2022

Hi, no specific reason for not adding this except that I didn't need it so far ;)
I'd be happy to accept a PR adding this functionality. Other than this, it should also be totally fine to use the user pool like you did in your example!

@hoIIer
Copy link
Author

hoIIer commented Apr 4, 2022

Hey, ok yeah the signup needs better handling for promises like below:
https://github.com/aws-amplify/amplify-js/blob/main/packages/auth/src/Auth.ts#L362-L388

Will see if I can take a crack at it later this week perhaps

@mydea
Copy link
Contributor

mydea commented Apr 4, 2022

Yeah, you'll need to wrap it like the other methods - I guess it should be realtively straightforward to follow the same schema as for all the other stuff, but let me know if you need guidance somewhere!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants