Skip to content

Instantly share code, notes, and snippets.

@shinecita
Created November 23, 2012 17:59
Show Gist options
  • Save shinecita/4136664 to your computer and use it in GitHub Desktop.
Save shinecita/4136664 to your computer and use it in GitHub Desktop.
var sha = crypto.createHash('sha1');
sha.update((new Date()).toString() + invitedUser.email);
invitedUser.token = sha.digest('hex');
User.save(invitedUser, function (err, invitedUser) {
User.addOrganizations(invitedUser, organizations, function() {
callback(err, invitedUser);
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment