ecrs-auth-core 1.0.68 → 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.
- package/dist/auth.controller.js +1 -0
- package/dist/auth.service.js +8 -7
- package/package.json +1 -1
package/dist/auth.controller.js
CHANGED
|
@@ -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
|
package/dist/auth.service.js
CHANGED
|
@@ -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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
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
|
/**
|