aloux-iam 0.0.84 → 0.0.85
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 +6 -1
- package/package.json +1 -1
package/lib/services/auth.js
CHANGED
|
@@ -88,7 +88,12 @@ self.login = async (body, res) => {
|
|
|
88
88
|
}
|
|
89
89
|
|
|
90
90
|
if (userLogin.status !== 'Activo') {
|
|
91
|
-
|
|
91
|
+
if(userLogin.status === "Inactivo"){
|
|
92
|
+
throw { code: 401, title: 'Usuario inactivo', detail: 'Usuario desactivado por el administrador.', suggestion: 'Pongase en contacto con el área administrativa.', error: new Error(), status: userLogin.status }
|
|
93
|
+
|
|
94
|
+
}else{
|
|
95
|
+
throw { code: 401, title: 'Usuario bloqueado', detail: 'Tu cuenta ha sido bloqueada debido a múltiples intentos fallidos de inicio de sesión.', suggestion: 'Para reactivar tu cuenta, utiliza la opción de recuperación de contraseña e intenta nuevamente.', error: new Error(), status: userLogin.status }
|
|
96
|
+
}
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
const isPasswordMatch = await bcrypt.compare(pwd, userLogin.pwd)
|