12. Signing in a user


#1

I get the following error with this code below "SignInUser is not defined":

-function signInUser(){
    var client = new Usergrid.Client({
        //Initialize your client here
        orgName:"JacobJohn",
        appName:"sandbox"
    });
    
    //Set a username
    var username = "JacobJohn";
    
    //Set a password
    var password = "Jacobjohn001";
    
    //Call the login function below
    client.login(username, password, function(error, data, user){
        if(error) {
            $("#error").append("An error occurred!");
        } else {
            //Here we want to get() the username property from user
            var username = user.get("username")
            //Here we want to get() the picture property from user
            var picture= user.get("picture")
            //Lets append them to the page.
            $("#profilePicture").append("<img src='"+picture+"' />");
            $("#username").append(username);
        }
    });
    
}

#2

remove the '-' from in front of function.

Not sure why this happened, but something similar happened to me. I went back to the previous exercise to copy the username I had made, and when I pasted it back in, my function somehow got the username added at the very top.