Skip to content

Instantly share code, notes, and snippets.

@auggernaut
Created September 10, 2013 22:36
Show Gist options
  • Save auggernaut/6516742 to your computer and use it in GitHub Desktop.
Save auggernaut/6516742 to your computer and use it in GitHub Desktop.
GratziCosmos old register methods
var creds = { "user": $("#username").val(), "email": $("#email").val(), "pass": $("#reg-password").val() };
var user;
var appname = Gratzi.Config.appName;
Gratzi.register(creds, function (err, res) {
if (res) {
console.log(res);
user = res.details;
Cosmos.register(creds, user.star, appname, function (err, res) {
if (res) {
console.log(res);
Cosmos.save(user.json(), user.sector, user.node, function (err, res) {
if (res) {
console.log(res);
window.location.href = "#profile";
}
else {
console.log(err);
$("#register-message").show().html(err.message);
}
});
}
else {
console.log(err);
$("#register-message").show().html(err.message);
}
});
}
else {
console.log(err);
$("#register-message").show().html(err.message);
$("#register-message").addClass("text-error");
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment