Hi, sorry if this is a stupid noob question, but I’m wondering if it’s possible to remove or redefine an already defined meteor method? Something like the following:
Meteor.methods({
"doFoo": function() {
// do something here
}
});
// somewhere else in code, something like:
Meteor.removeMethod('doFoo');
Necromancing your question I needed to do this for a password rotation scheme.
Here’s what I came up with:
// First, we delete the existing handler
delete Meteor.server.method_handlers.changePassword;
delete Meteor.default_server.method_handlers.changePassword;
// Next we redefine the method.
Meteor.methods({changePassword: function (oldPassword, newPassword) {
...
}
});