ecrs-auth-core 1.0.97 → 1.0.98

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.
@@ -55,12 +55,12 @@ let AuthController = class AuthController {
55
55
  console.warn(`⚠️ Invalid module ID provided by user ${body.email}: ${body.moduleId}`);
56
56
  throw new common_1.UnauthorizedException('You are not authorized to access this module');
57
57
  }
58
- console.log(`🔍 Checking module access for user ID ${user.id} and module ID ${requestedModuleId}...`);
59
- const allowedDb = await this.authService.hasModuleAccess(user.id, requestedModuleId);
60
- console.log(`📊 Module access check result for user ID ${user.id} and module ID ${requestedModuleId}: ${allowedDb ? 'Allowed' : 'Denied'}`);
61
- if (!allowedDb) {
62
- throw new common_1.UnauthorizedException('You are not authorized to access this module');
63
- }
58
+ // console.log(`🔍 Checking module access for user ID ${user.id} and module ID ${requestedModuleId}...`);
59
+ // // const allowedDb = await this.authService.hasModuleAccess(user.id, requestedModuleId);
60
+ // console.log(`📊 Module access check result for user ID ${user.id} and module ID ${requestedModuleId}: ${allowedDb ? 'Allowed' : 'Denied'}`);
61
+ // if (!allowedDb) {
62
+ // throw new UnauthorizedException('You are not authorized to access this module');
63
+ // }
64
64
  // const perms = await this.authService.getPermissions(user.id);
65
65
  // console.log(`📊 User permissions for ${body.email}:`, perms);
66
66
  // if (!Array.isArray(perms.modules) || !perms.modules.includes(requestedModuleId)) {
@@ -27,12 +27,11 @@ let JwtStrategy = class JwtStrategy extends (0, passport_1.PassportStrategy)(pas
27
27
  const user = await this.authService.findUserById(payload.id);
28
28
  if (!user)
29
29
  return null;
30
- if (payload.moduleId) {
31
- const hasAccess = await this.authService.hasModuleAccess(user.id, payload.moduleId);
32
- if (!hasAccess)
33
- return null;
34
- console.log(`✅ User ${user.id} has access to module ${payload.moduleId}`);
35
- }
30
+ // if (payload.moduleId) {
31
+ // const hasAccess = await this.authService.hasModuleAccess(user.id, payload.moduleId);
32
+ // if (!hasAccess) return null;
33
+ // console.log(`✅ User ${user.id} has access to module ${payload.moduleId}`);
34
+ // }
36
35
  console.log(`✅ JWT validated for user ${user.id}`);
37
36
  return {
38
37
  id: user.id,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecrs-auth-core",
3
- "version": "1.0.97",
3
+ "version": "1.0.98",
4
4
  "description": "Centralized authentication and authorization module for ECRS apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",