lib/engine.js
function(criteria, attributes, cb){
      var self = this;
      waterlock.Auth.findOrCreate(criteria, attributes)
      .exec(function(err, newAuth){
        if(err){
          waterlock.logger.debug(err);
          return cb(err);
        }

        waterlock.Auth.findOne(newAuth.id).populate('user')
        .exec(function(err, auth){
          if(err){
            waterlock.logger.debug(err);
            return cb(err);
          }

          self._attachAuthToUser(auth, cb);
        });
      });
    }
function(criteria, attributes, cb){
      var self = this;
      waterlock.Auth.findOrCreate(criteria, attributes)
      .exec(function(err, newAuth){
        if(err){
          waterlock.logger.debug(err);
          return cb(err);
        }

        waterlock.Auth.findOne(newAuth.id).populate('user')
        .exec(function(err, auth){
          if(err){
            waterlock.logger.debug(err);
            return cb(err);
          }

          self._attachAuthToUser(auth, cb);
        });
      });
    }
function ( criteria , attributes , cb ) { var self = this ; waterlock . Auth . findOrCreate ( criteria , attributes ) . exec ( function ( err , newAuth ) { if ( err ) { waterlock . logger . debug ( err ) ; return cb ( err ) ; } waterlock . Auth . findOne ( newAuth . id ) . populate ( 'user' ) . exec ( function ( err , auth ) { if ( err ) { waterlock . logger . debug ( err ) ; return cb ( err ) ; } self . _attachAuthToUser ( auth , cb ) ; } ) ; } ) ; }
Find or create the auth then pass the results to _attachAuthToUser

@param  {Object}   criteria   should be id to find the auth by
@param  {Object}   attributes auth attributes
@param  {Function} cb         function to be called when the auth has been
found or an error has occurred

@api public
Find or create the auth then pass the results to _attachAuthToUser