11 Signing up a user


#1

Here's my code:

function signupUser(){
var client = new Usergrid.Client({
    //Don't forget to intialize the SDK with the correct orgName!
    orgName:"chipmunk",
    appName:"sandbox"
});

//Set a username
var username = "fiona_fox";

//Set a password
var password = "shadowthehedgehog";

//Set an email
var email = "queendelansearose20@gmail.com";

//Set a name
var name = "Fiona_Fox";

//Call signup() below!
client.signup(username, password, email, name, function(error, user){
    if(error) {
        $("#error").append("There was an error");
    } else {
        //Get the username property from user
        var username = user.get("username");
        //Get the picture property from user
        var picture = user.get("picture");
        $("#profilePicture").append("<img src='"+picture+"' />");
        $("#username").append("Your username:"+username);
     }  
  });
}

Here's my error:

Oops, try again. Looks like there was an error signing you up. Is your email taken already? Did you fill out all the parameters correctly?

I can't figure out what I did wrong. Can someone help?


#2

This happened to me, and it turns out I had incorrectly entered my orgName.