ecrs-auth-core 1.0.69 → 1.0.70

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,6 +31,7 @@ let AuthController = class AuthController {
31
31
  console.log(`📍 Login attempt from IP: ${clientIp}, User-Agent: ${userAgent}`);
32
32
  // Validate user with IP restriction check
33
33
  const user = await this.authService.validateUser(body.email, body.password, clientIp);
34
+ console.log(`🔐 User validation result for ${body.email}: ${user ? 'Success' : 'Failed'}`);
34
35
  if (!user) {
35
36
  // Save failed login attempt
36
37
  await this.authService.saveLastLogin({ email: body.email }, clientIp, 'failed', 'Invalid credentials or IP not allowed', additionalData).catch(() => { }); // Ignore errors
@@ -76,14 +76,15 @@ let AuthService = class AuthService {
76
76
  const isValid = await bcrypt.compare(password, user.password);
77
77
  if (!isValid)
78
78
  return null;
79
+ // console.log(this.ipRestrictionsRepo);
79
80
  // Check IP restrictions if provided and repository is available
80
- if (clientIp && this.ipRestrictionsRepo) {
81
- const ipAllowed = await this.validateIpRestriction(user.id, clientIp);
82
- if (!ipAllowed) {
83
- // IP restriction exists but doesn't match - return null to block login
84
- return null;
85
- }
86
- }
81
+ // if (clientIp && this.ipRestrictionsRepo) {
82
+ // const ipAllowed = await this.validateIpRestriction(user.id, clientIp);
83
+ // if (!ipAllowed) {
84
+ // // IP restriction exists but doesn't match - return null to block login
85
+ // return null;
86
+ // }
87
+ // }
87
88
  return user;
88
89
  }
89
90
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ecrs-auth-core",
3
- "version": "1.0.69",
3
+ "version": "1.0.70",
4
4
  "description": "Centralized authentication and authorization module for ECRS apps",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",