@wrcb/cb-common 1.0.500 → 1.0.502

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -31,7 +31,10 @@ function createRateApiLimiter(options) {
31
31
  // Verificando a versão do RedisStore
32
32
  // Para versões mais recentes (>= 3.x)
33
33
  if (typeof rate_limit_redis_1.default === 'function') {
34
- return (0, express_rate_limit_1.default)(Object.assign(Object.assign({ windowMs: windowMinutes * 60 * 1000, max, standardHeaders: true, legacyHeaders: false }, (process.env.NODE_ENV !== 'development'
34
+ return (0, express_rate_limit_1.default)(Object.assign(Object.assign({ windowMs: windowMinutes * 60 * 1000, max, standardHeaders: true, legacyHeaders: false, validate: {
35
+ trustProxy: false, // Desabilita validação de proxy
36
+ xForwardedForHeader: false // Desabilita validação de X-Forwarded-For
37
+ } }, (process.env.NODE_ENV !== 'development'
35
38
  ? { trustProxy: true }
36
39
  : {})), { store: new rate_limit_redis_1.default({
37
40
  prefix,
@@ -52,6 +55,10 @@ function createRateApiLimiter(options) {
52
55
  max,
53
56
  standardHeaders: true,
54
57
  legacyHeaders: false,
58
+ validate: {
59
+ trustProxy: false, // Desabilita validação de proxy
60
+ xForwardedForHeader: false // Desabilita validação de X-Forwarded-For
61
+ },
55
62
  store: new rate_limit_redis_1.default({
56
63
  prefix,
57
64
  client: redisClient
@@ -28,6 +28,9 @@ const requireHybridAuth = (req, res, next) => __awaiter(void 0, void 0, void 0,
28
28
  };
29
29
  return next();
30
30
  }
31
+ if (!req.currentUser) {
32
+ throw new notAuthorizedError_1.NotAuthorizedError('NotAuthorized');
33
+ }
31
34
  next();
32
35
  });
33
36
  exports.requireHybridAuth = requireHybridAuth;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrcb/cb-common",
3
- "version": "1.0.500",
3
+ "version": "1.0.502",
4
4
  "description": "Common resources between services",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",