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.
@@ -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()
@@ -21,7 +21,8 @@ self.create = async (body) => {
21
21
  user.status = body?.status ? body?.status : 'Activo'
22
22
 
23
23
  delete user.pwd
24
-
24
+ user.data = {}
25
+ user.data.changePwd = false
25
26
  await user.save()
26
27
 
27
28
  return user
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aloux-iam",
3
- "version": "0.0.76",
3
+ "version": "0.0.77",
4
4
  "description": "Aloux IAM for APIs ",
5
5
  "main": "index.js",
6
6
  "scripts": {