Created
September 10, 2013 22:36
-
-
Save auggernaut/6516742 to your computer and use it in GitHub Desktop.
GratziCosmos old register methods
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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