Code Monkey home page Code Monkey logo

aws-amplify-react-custom-ui's Issues

ConfirmSignUp custom UI does not keep the user signed in

Hello. I am using your library to create a custom ConfirmSignUp. It works great for SignIn and SignUp but when I want to confirm the Sign Up it renders a blank page, and if I refresh it takes me back to sign in.
Here is my function :
onSubmit = (event) => {
const { username, verificationCode } = this.state;

    Auth.confirmSignUp(username, verificationCode)
        .then((user) => {
            this.changeState("signedUp", user);
        })
        .catch(err => {
            this.setState(updateByPropertyName("error", err));
        });
    event.preventDefault();

};

Thank you

How can I pass authData between components?

First of all, thanks for such a great package, the UI is looking great thanks to this customisation.

I have created 2 class components, one for SigIn, another for NewPassword, i.e. overriding the auto-generated password when an admin creates a new account in Cognito.

The components are successfully loaded like this

AmplifyCustomUi.setSignIn(SignIn);
AmplifyCustomUi.setRequireNewPassword(NewPassword);

The SignIn component is able to create a Cognito session and returns the payload in the user result object.

const user = await Auth.signIn(username, password);

if (!user.challengeName) {
  this.changeState("signedIn", user);
  return true;
}

if (user.challengeName === "NEW_PASSWORD_REQUIRED") {
  this.changeState("requireNewPassword", user);
}
return false;

The problem is that the NewPassword component does not receive the user content via props.
Could you provide an example of how could I retrieve the user, so that I can invoke the following Amplify function to set the initial password?

const result = await Auth.completeNewPassword(user, password, {});

thanks very much,

Jaume

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.