code: function (model) {
                var tokenCode = 'token-' + md5(new Date().toString()) + md5(model.id + Math.random().toString());
                var redisExpire = (global._gluon_auth_expire) >>> 0; //redis using seconds not milliseconds
                return redisClient.setAsync(tokenCode, JSON.stringify(model.toJSON())).then(function () {
                  return redisClient.expireAsync(tokenCode, redisExpire);
                }).then(function () {
                  return {code: tokenCode, expire: new Date(Date.now() + redisExpire * 1000)};
                });
              }
docs: Creates a token for model
  @param {Model} model
  @returns {Promise.<TResult>}