bnoguchi/mongoose-auth — Issue #64: Hardcoding and naming convention
Author: shished
Created: 2011-12-08 16:33:35+00:00
State: open

I think you shouldn't be hardcoding the "fb.id", "twit.id", I think it should be:
this.name + ".id"

Why? because if I want to create a generic method to find a user, I have to use a switch/case or config for these naming convention. For example:

User.findOne({'fb.id': fbUser.id}, function (err, foundUser) {
});

I would rather see something like:
User.findOne({ this.name + '.id': aUser.id}, function (err, foundUser) {
});

this.name should respect what you set in the everyauth module ie: facebook, twitter, github, ...