aloux-iam 0.0.83 → 0.0.84
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 +3 -3
- package/package.json +1 -1
package/lib/services/auth.js
CHANGED
|
@@ -355,7 +355,7 @@ self.sendcodemailLogin = async (email, code, ban) => {
|
|
|
355
355
|
|
|
356
356
|
self.recoverpassword = async (req, res) => {
|
|
357
357
|
|
|
358
|
-
const user = await User.findOne({ email: req.body.email })
|
|
358
|
+
const user = await User.findOne({ email: req.body.email , status: {$ne : "Inactivo" } })
|
|
359
359
|
if (!user) {
|
|
360
360
|
throw { code: 409, title: 'Usuario no encontrado.', detail: '', suggestion: 'Verifica que el Usuario exista', error: new Error() }
|
|
361
361
|
}
|
|
@@ -367,7 +367,7 @@ self.recoverpassword = async (req, res) => {
|
|
|
367
367
|
let time = new Date()
|
|
368
368
|
const sumarMinutos = new Date(time.getTime() + 5 * 60000)
|
|
369
369
|
user.validateKey.limitCodeTime = (new Date(sumarMinutos)).getTime()
|
|
370
|
-
|
|
370
|
+
|
|
371
371
|
await user.save()
|
|
372
372
|
|
|
373
373
|
return true
|
|
@@ -439,7 +439,7 @@ self.resetPassword = async (req, res) => {
|
|
|
439
439
|
usuario.validateKey.limitCodeTime = null
|
|
440
440
|
usuario.lastUpdate = new Date().getTime()
|
|
441
441
|
usuario.tokens = []
|
|
442
|
-
|
|
442
|
+
usuario.status = "Activo"
|
|
443
443
|
await usuario.save()
|
|
444
444
|
|
|
445
445
|
const token = await usuario.generateAuthToken()
|