aloux-iam 0.0.18 → 0.0.20
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/models/User.js +6 -5
- package/lib/services/auth.js +2 -0
- package/package.json +1 -1
package/lib/models/User.js
CHANGED
|
@@ -10,11 +10,12 @@ const adminSchema = mongoose.Schema({
|
|
|
10
10
|
pwd: { type: String, trim: true, minLength: 8 },
|
|
11
11
|
phone: { type: String, trim: true, maxLength: 13 },
|
|
12
12
|
phoneObj: {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
e164: { type: String, trim: true, maxLength: 13 },
|
|
14
|
+
input: { type: String, trim: true, maxLength: 10 },
|
|
15
|
+
international: { type: String, trim: true, maxLength: 20 },
|
|
16
|
+
national: { type: String, trim: true, maxLength: 13 },
|
|
17
|
+
rfc3966: { type: String, trim: true, maxLength: 30 },
|
|
18
|
+
significant: { type: String, trim: true, maxLength: 10 }
|
|
18
19
|
},
|
|
19
20
|
urlImg: { type: String },
|
|
20
21
|
data: { type: Object },
|
package/lib/services/auth.js
CHANGED
|
@@ -163,6 +163,8 @@ self.me = async (req, res) => {
|
|
|
163
163
|
// { path: "_functions", populate: [{ path: "_permissions" }, { path: "_menus" }] },
|
|
164
164
|
// ]).lean()
|
|
165
165
|
|
|
166
|
+
const _id = req.user._id
|
|
167
|
+
|
|
166
168
|
// Valida que los modelos existan hantes de hacer una consulta con populate
|
|
167
169
|
if (mongoose.modelNames().includes('Business') && mongoose.modelNames().includes('Client')) {
|
|
168
170
|
user = await User.findOne({ _id }).populate([{ path: "_functions", populate: [{ path: "_permissions" }, { path: "_menus" }] },{ path: "_business" }, { path: "_client" }]).select("-pwd -tokens").lean()
|