docs: function generateBearerToken(tokenSecret, expiresInMinutes = 60 * 24 * 14, scope = []) {
    if (!tokenSecret) {
      throw new Error('Token secret is undefined');
    }
  
    const data = {
      user: this._id.toString(),
    };
  
    if (scope.length) {
      data.scope = scope;
    }
  
    const token = jwt.sign(data, tokenSecret, {
      expiresInMinutes,
    });
  
    return {
      type: 'Bearer',
      value: token,
    };
  }