bengott/meteor-avatar

how should i use the emailHashProperty option

Closed this issue · 2 comments

Hi There,

I'm not 100% clear on the emailHashProperty option, if its the right thing for what I'm after with this package or if what I want to do is possible here.

I'd like to not publish the user emails, (avatars stopped working of course which is what pointed me at this option). I do set a profile.primaryemail property that is available and is what I'd ideally like it to reference. Is this possible or have I misunderstood this option?

Thanks and regards

Paul

First off, sorry for the late reply. I'm playing catchup now...

Yeah, it sounds like you're misunderstanding the emailHashProperty option. Its purpose is to allow the package to use an email hash for retrieving Gravatars instead of having to publish users' email addresses to all clients. As an example, Telescope creates a hash of the user's email address (looks something like "2c26c27339c7055dde24bd2f161404ba") and stores it in user.email_hash, so the emailHashProperty would be set to "email_hash". In your case, storing the users' email addresses in user.profile.primaryemail instead of user.emails or somewhere else doesn't prevent them from being published.

Check out how it's done in Telescope:
https://github.com/TelescopeJS/Telescope/blob/devel/server/users.js#L25
https://github.com/TelescopeJS/Telescope/blob/devel/server/users.js#L65

Thanks, that makes a lot more sense.