Are you sure the login goes through after you register the user?
Take a look, here’s the code to register the user:
var user = new Backendless.User();
user.name = "Darel Johnson";
user.password = "watchingya";
user.email = "dareljohnson@msn.com";
user.username = "dejohnny2";
function registerUser(param)
{
user = param || {};
this.name = user.name.replace(/\s/g, '') || null;
this.username = user.username.replace(/\s/g, '') || null;
this.password = user.password.replace(/\s/g, '') || null;
this.email = user.email.replace(/\s/g, '') || null;
Backendless.UserService.register( user, new Backendless.Async( userRegistered, gotError ) );
}
registerUser(user);
And this is the code to login. Notice the email address below is different than the email address in the code above. The login should fail and as a result, the subsequent update will fail too.
// Login user
var login = "dareljohnson@yahoo.com";
var password = "watchingya";
Backendless.UserService.login(login, password, new Backendless.Async( userLoggedIn, gotError ));
Well yes and no. I made the email addresses the same, but no change in the way the app behaves. Since the user already exist on the server, I get an error message that says, “Unable to register user. User already exists.”
After that, when the Backendless.UserService.login() is fired, I can see that the user is logged In.
However, the code doesn’t let me update the same user that was previuosly registered.
Use the new Code Generation feature available directly in the console. Click “Code Generation”, select JavaScript, click all the checkboxes you want to get the code generated for and then click Download project.
alternatively,
check out the user service example included into the SDK for JavaScript
The Code Generation option is the one I would recommend.