aloux-iam 0.0.85 → 0.0.86
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/lib/services/auth.js +5 -0
- package/package.json +1 -1
package/lib/services/auth.js
CHANGED
|
@@ -114,14 +114,18 @@ self.login = async (body, res) => {
|
|
|
114
114
|
if(!userLogin?.data){
|
|
115
115
|
userLogin.data.changePwd = false
|
|
116
116
|
changePwd= false
|
|
117
|
+
userLogin.validateKey.failedAttempts = 0
|
|
117
118
|
await userLogin.save()
|
|
118
119
|
|
|
119
120
|
}else if( !userLogin?.data?.changePwd ){
|
|
120
121
|
userLogin.data.changePwd = false
|
|
121
122
|
changePwd= false
|
|
123
|
+
userLogin.validateKey.failedAttempts = 0
|
|
122
124
|
await userLogin.save()
|
|
123
125
|
}else{
|
|
124
126
|
changePwd = userLogin.data.changePwd
|
|
127
|
+
userLogin.validateKey.failedAttempts = 0
|
|
128
|
+
await userLogin.save()
|
|
125
129
|
}
|
|
126
130
|
|
|
127
131
|
res.cookie("token", token, {
|
|
@@ -442,6 +446,7 @@ self.resetPassword = async (req, res) => {
|
|
|
442
446
|
usuario.validateKey.resetPassword.validCode = false
|
|
443
447
|
usuario.validateKey.resetPassword.resetCode = null
|
|
444
448
|
usuario.validateKey.limitCodeTime = null
|
|
449
|
+
usuario.validateKey.failedAttempts = 0
|
|
445
450
|
usuario.lastUpdate = new Date().getTime()
|
|
446
451
|
usuario.tokens = []
|
|
447
452
|
usuario.status = "Activo"
|