aloux-iam 0.0.76 → 0.0.77
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 -1
- package/lib/services/user.js +2 -1
- package/package.json +1 -1
package/lib/services/auth.js
CHANGED
|
@@ -408,7 +408,7 @@ self.resetPassword = async (req, res) => {
|
|
|
408
408
|
var body = JSON.parse(JSON.stringify(req.body))
|
|
409
409
|
let usuario = await User.findOne({ email: correo })
|
|
410
410
|
|
|
411
|
-
if (!usuario) {
|
|
411
|
+
if (!usuario || !usuario?.data?.changePwd ) { //evaluar si se queda
|
|
412
412
|
throw { code: 409, title: 'Usuario no encontrado.', detail: '', suggestion: 'Verifica que el usuario exista', error: new Error() }
|
|
413
413
|
}
|
|
414
414
|
|
|
@@ -608,6 +608,8 @@ self.createCustomer = async (req, res) => {
|
|
|
608
608
|
}
|
|
609
609
|
user._functions.push(fun._id)
|
|
610
610
|
delete user.pwd
|
|
611
|
+
user.data = {}
|
|
612
|
+
user.data.changePwd = false
|
|
611
613
|
let newCustomer = await user.save()
|
|
612
614
|
await UserProvisional.deleteOne({email: newCustomer.email})
|
|
613
615
|
const token = await newCustomer.generateAuthToken()
|
package/lib/services/user.js
CHANGED