generateToken = (userId, expires, type, secret = config.jwt.secret) => {
  const payload = {
    sub: userId,
    iat: moment().unix(),
    exp: expires.unix(),
    type,
  };
  return jwt.sign(payload, secret);
}
Generate token
@param {ObjectId} userId
@param {Moment} expires
@param {string} type
@param {string} [secret]
@returns {string}