j3k0 / ganomede-directory

Ganomede directory microservice
1 stars 1 forks source link

Throws: Can not convert Profile to JSON directly #25

Closed j3k0 closed 7 years ago

j3k0 commented 7 years ago

Warning showed on all get requests. What does it mean?

[2017-04-22T08:21:21.532Z] DEBUG: ganomede-directory/16 on f7542865abf7: directory.router.sendProfileBack (err=null)
    profile: [Throws: Can not convert Profile to JSON directly; use #public() or #private()]
elmigranto commented 7 years ago

Did this so that we don't accidentally res.json(profile) with password hash, etc. Not sure why is this a case, I believe I made it send either #public() or #private() with appropriate aliases based on access level.

elmigranto commented 7 years ago

Maybe it is printed when logging a profile object? Will need to .debugInspect() it instead then. Will take a look.