Reputation: 17322
I'm creating a new user with Accounts.createUser()
on client side in a Admin-Frontend. This works, but after creating the user, there is a auto-login, which is very logic, as the input has be done on client side.
But I want to create new users by an admin-account on frontend.
So I thought about creating a server-method, calling from client. But that doesn't work:
server.js
Meteor.methods({
'createUserByAdmin': function(){
console.log("Hello world");
// Create user here
}
});
client.js
Template.users.events({
'submit form': function(event) {
event.preventDefault();
Meteor.call('createUserByAdmin');
}
});
Now I would expect by submiting the form there should be "Hello world" on the console. But I don't get anything.
Upvotes: 2
Views: 1416