Skip to content

Instantly share code, notes, and snippets.

@Azeirah
Created August 30, 2014 14:47
Show Gist options
  • Save Azeirah/fe0595987a0523cc416e to your computer and use it in GitHub Desktop.
Save Azeirah/fe0595987a0523cc416e to your computer and use it in GitHub Desktop.
adding to profile
Template.register.events({
'submit #register-form': function(event, t) {
event.preventDefault();
var email = t.find('#register-email').value.toLowerCase();
var password = t.find('#register-password').value;
var username = t.find('#register-username').value;
Accounts.createUser({
email: email,
password: password,
username: username,
profile: {
friends: []
}
}, function(error) {
if (error) {
FlashMessages.sendError("Registration failed");
} else {
FlashMessages.sendInfo("Registration succesful");
Meteor.loginWithPassword(password);
Router.go('home');
}
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment