I would like to pass a "token" object to POST /MyObject. The easiest way to do that seems to be to add it as a property to MyObject.json. The problem is that this token is not persisted (it doesn't last for very long and there's no need to save it).
I figured out how to get around this issue for POST:
MyObject.beforeRemote('create', function (context, unused, nextFn) {
var token = context.args.data.token;
//We have to delete this so it doesn't try to put it in the database
delete context.args.data.token;
nextFn();
});
But the code crashes when I do a GET.
I tried just adding it as a second parameter to a new remote method, with MyObject as the first param, but after wrestling with strongloop for three hours and having nothing to show for it I gave up/
Is there any way to just add a property so that I can use it in node, but keep it from being persisted?