How to use the aws-amplify.Auth.signUp function in aws-amplify

To help you get started, we’ve selected a few aws-amplify examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github mzohaibqc / antd-amplify-react / src / SignUpForm.js View on Github external
signUp () {
    const { email, password, role } = this.inputs;
    this.setState({ loading: true, error: false });
    Auth.signUp({
      username: email,
      password,
      attributes: {
        email,
        "custom:role": role
      }
    })
      // Auth.signUp(username, password, email, phone_number)
      .then(data => {
        this.setState({ loading: false });
        this.changeState("confirmSignUp", data);
      })
      .catch(err => {
        this.setState({ loading: false, error: err.message });
        message.error(err.message);
      });
github pjay79 / MoviesApp / app / screens / SignUpScreen.js View on Github external
signUp = async () => {
    this.setState({ loading: true, error: '' });
    const {
      username, password, email, phone_number,
    } = this.state;
    if (username && password && email && phone_number) {
      await Auth.signUp({
        username,
        password,
        attributes: {
          phone_number,
          email,
        },
      })
        .then((data) => {
          this.setState({ loading: false, status: 'User confirmation pending...' });
          console.log(data);
        })
        .catch((error) => {
          this.setState({ loading: false, error: error.message });
        });
    } else {
      this.setState({ loading: false, error: 'Complete missing fields.' });
github aws-samples / aws-amplify-auth-starters / src / nav / auth / SignUp.js View on Github external
signUp = async () => {
    const {
      username, password, email, phone_number
    } = this.state
    try {
      await Auth.signUp({ username, password, attributes: { email, phone_number }})
      console.log('successful sign up..')
      this.setState({ stage: 1 })
    } catch (err) {
      console.log('error signing up...', err)
    }
  }
  confirmSignUp = async () => {
github AnomalyInnovations / serverless-stack-demo-client / src / containers / Signup.js View on Github external
async function handleSubmit(event) {
    event.preventDefault();

    setIsLoading(true);

    try {
      const newUser = await Auth.signUp({
        username: fields.email,
        password: fields.password
      });
      setIsLoading(false);
      setNewUser(newUser);
    } catch (e) {
      alert(e.message);
      setIsLoading(false);
    }
  }
github dabit3 / gatsby-auth-starter-aws-amplify / src / components / SignUp.js View on Github external
signUp = async() => {
    const { username, password, email, phone_number } = this.state
    try {
      await Auth.signUp({ username, password, attributes: { email, phone_number }})
      this.setState({ stage: 1 })
    } catch (err) {
      this.setState({ error: err })
      console.log('error signing up...', err)
    }
  }
github gerardkabre / ReactNative-FurgoAppClone / app / actions / user.js View on Github external
return dispatch => {
    dispatch(createUser());
    return Auth.signUp(data)
      .then(res => {
        dispatch(createUserSuccess(res));
        Actions.navigate('SignIn');
      })
      .catch(err => {
        dispatch(createUserError(err));
      });
  };
}