_transform on Meteor.users... exception on .login()

Something weird… My app throws an exception when I use a _transform() om Meteor.users and try to login.

Meteor.users._transform = function (doc) {
  return _.extend(UserPrototype, doc);

Results in (server side):

Exception while invoking method 'login' undefined

I can drill down the method call in accounts-base.js (server), but for the life of my I can’t find out how to debug that. Anybody else came across something like this?


Sheer luck, but it seems I found the culprit (which is me of course). it’s that my prototype contains a “clone()” method, which is also part of what accounts-base adds to user. So it seems I’ve overwritten it :smile: