meteor-restivus
meteor-restivus copied to clipboard
Error in using AddCollection in Meteor.user
When I try to add Meteor.users for REST authentication, my app is crashing.
I used the code found in the documentation code itself:
Api.addCollection(Meteor.users, { excludedEndpoints: ['getAll', 'put'], routeOptions: { authRequired: true }, endpoints: { post: { authRequired: false }, delete: { roleRequired: 'admin' } } });
The error I get is:
/Users/abel/.meteor/packages/meteor-tool/.1.4.2_6.1y6rhi4++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:280 throw(ex); ^
TypeError: Cannot read property 'call' of undefined
at Restivus.
Try this: Api.addCollection(Meteor.users, { excludedEndpoints: [ 'put','post','delete','patch'], routeOptions: { authRequired: false } });
Am getting the same error with 0.8.12 but its okay with 0.8.11.
The example above works but if you remove 'patch' from excludedEndpoints
array
Api.addCollection(Meteor.users, {
excludedEndpoints: [ 'put','post','delete'],
routeOptions: {
authRequired: false
}
});
then the error occurs. Mmmm, I think patch might need a patch (sorry, couldn't hold that one back).
Found it - the _userCollectionEndpoints
object doesn't have a patch
method.