aloux-iam 0.0.70 → 0.0.71
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 +2 -2
- package/package.json +1 -1
package/lib/services/auth.js
CHANGED
|
@@ -578,8 +578,6 @@ self.createCustomer = async (req, res) => {
|
|
|
578
578
|
user.status = req.body?.status ? req.body?.status : 'Activo'
|
|
579
579
|
let fun
|
|
580
580
|
if(req.body?.assignedRole){
|
|
581
|
-
fun = await Function.findOne({ name: process.env.FUNCTION_NAME },{ name: 1 }).lean()
|
|
582
|
-
}else{
|
|
583
581
|
fun = await Function.findOne({ _id: req.body?.assignedRole },{ name: 1 }).lean()
|
|
584
582
|
if(fun?.name === 'Propietario'){
|
|
585
583
|
throw {
|
|
@@ -590,6 +588,8 @@ self.createCustomer = async (req, res) => {
|
|
|
590
588
|
error: new Error()
|
|
591
589
|
}
|
|
592
590
|
}
|
|
591
|
+
}else{
|
|
592
|
+
fun = await Function.findOne({ name: process.env.FUNCTION_NAME },{ name: 1 }).lean()
|
|
593
593
|
}
|
|
594
594
|
user._functions.push(fun._id)
|
|
595
595
|
delete user.pwd
|