lib/validator.js
function(token, cb){
      // deserialize the token iss
      var _iss = token.iss.split('|');

      waterlock.User.findOne(_iss[0]).exec(function(err, user){
        if(err){
          waterlock.logger.debug(err);
        }

        cb(err, user);
      });
    }
function(token, cb){
      // deserialize the token iss
      var _iss = token.iss.split('|');

      waterlock.User.findOne(_iss[0]).exec(function(err, user){
        if(err){
          waterlock.logger.debug(err);
        }

        cb(err, user);
      });
    }
function ( token , cb ) { // deserialize the token iss var _iss = token . iss . split ( '|' ) ; waterlock . User . findOne ( _iss [ 0 ] ) . exec ( function ( err , user ) { if ( err ) { waterlock . logger . debug ( err ) ; } cb ( err , user ) ; } ) ; }
Find the user the give token is issued to

@param  {Object}   token The parsed token
@param  {Function} cb    Callback to be called when a user is
found or an error has occured
Find the user the give token is issued to