Vulcan/client/views/users/user_signup.js
2012-11-26 17:11:21 +09:00

29 lines
No EOL
684 B
JavaScript

Template.user_signup.events = {
'click input[type=submit]': function(event){
event.preventDefault();
var username = $('#username').val();
var email = $('#email').val();
var password = $('#password').val();
Accounts.createUser({
username: username
, email: email
, password: password
}, function(err){
if(err){
console.log(err);
}else{
Meteor.Router.to('/');
}
});
},
'click #signin': function(){
Meteor.Router.to('/signin');
},
'click .twitter-button': function(){
Meteor.loginWithTwitter(function(){
Meteor.Router.to('/');
});
}
};