-
-
Save Azeirah/fe0595987a0523cc416e to your computer and use it in GitHub Desktop.
adding to profile
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
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