lib/controllers/actions/oauth2.js
function userInfoResponse(error, response, body){
    if (error) {
      waterlock.logger.debug(error);
      res.serverError();
    } else {
      var _data = JSON.parse(body);

      if(_data.error){
        waterlock.logger.debug(_data);
        res.serverError(_data.error);
      }

      var attr = {
        facebookId: _data.id,
        name: _data.name,
        username: _data.name.replace(' ', ''),
        email: _data.email
      };

      var fieldMap = authConfig.fieldMap || {};

      _.each(fieldMap, function(val, key) {
        if (!_.isUndefined(_data[val])) {
          attr[key] = _data[val];
        }
      });

      if(req.session.authenticated){
        attr['user'] = req.session.user.id;
        waterlock.engine.attachAuthToUser(attr, req.session.user, userFound);
      }else{
        waterlock.engine.findOrCreateAuth({facebookId: attr.facebookId}, attr, userFound);
      }
    }
  }
function userInfoResponse(error, response, body){
    if (error) {
      waterlock.logger.debug(error);
      res.serverError();
    } else {
      var _data = JSON.parse(body);

      if(_data.error){
        waterlock.logger.debug(_data);
        res.serverError(_data.error);
      }

      var attr = {
        facebookId: _data.id,
        name: _data.name,
        username: _data.name.replace(' ', ''),
        email: _data.email
      };

      var fieldMap = authConfig.fieldMap || {};

      _.each(fieldMap, function(val, key) {
        if (!_.isUndefined(_data[val])) {
          attr[key] = _data[val];
        }
      });

      if(req.session.authenticated){
        attr['user'] = req.session.user.id;
        waterlock.engine.attachAuthToUser(attr, req.session.user, userFound);
      }else{
        waterlock.engine.findOrCreateAuth({facebookId: attr.facebookId}, attr, userFound);
      }
    }
  }
[userInfoResponse description]
@param  {[type]} error    [description]
@param  {[type]} data     [description]
@param  {[type]} response [description]
@return {[type]}          [description]