aloux-iam 0.0.7 → 0.0.9

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.
@@ -284,7 +284,8 @@ self.getMe = async (req, res) => {
284
284
  try {
285
285
 
286
286
  let user = await User.findOne({ _id: req.user._id }, { "tokens": 0, pwd: 0 }).populate(
287
- {
287
+ [
288
+ {
288
289
  path: "_functions", populate: [
289
290
  {
290
291
  path: "_permissions", populate: [
@@ -298,7 +299,11 @@ self.getMe = async (req, res) => {
298
299
  ]
299
300
  }
300
301
  ]
302
+ },
303
+ {
304
+ path: "_business"
301
305
  }
306
+ ]
302
307
  ).lean()
303
308
 
304
309
  // Obtener menús y funciones sin repertir y activas
@@ -5,7 +5,7 @@ const ObjectId = mongoose.Schema.Types.ObjectId
5
5
 
6
6
  const adminSchema = mongoose.Schema({
7
7
  name: { type: String, required: true, trim: true },
8
- lastName: { type: String, required: true, trim: true },
8
+ lastName: { type: String, required: false, trim: true },
9
9
  email: { type: String, required: true, trim: true, unique: true, lowercase: true },
10
10
  pwd: { type: String, required: true, trim: true, minLength: 8 },
11
11
  phone: { type: String, trim: true, maxLength: 13 },
@@ -31,9 +31,9 @@ const adminSchema = mongoose.Schema({
31
31
  type: ObjectId, required: true, ref: 'Functions'
32
32
  }
33
33
  ],
34
- _client: [
34
+ _business: [
35
35
  {
36
- type: ObjectId, required: false, ref: 'Client'
36
+ type: ObjectId, required: false, ref: 'Business'
37
37
  }
38
38
  ],
39
39
  tokens: [
package/lib/router.js CHANGED
@@ -13,7 +13,7 @@ router.post('/iam/auth/email', auth.email)
13
13
  router.post('/iam/auth/login', auth.login)
14
14
  router.post('/iam/auth/forgot/password', auth.recoverpassword)
15
15
  router.post('/iam/auth/validate/code', auth.verifyCode)
16
- router.post('/iam/auth/verify/mail', auth.sendVerifyMailAccount)// sin documentar
16
+ router.post('/iam/auth/verify/mail', auth.sendVerifyMailAccount)
17
17
  router.get('/iam/auth/verify/mail/token/:token', auth.verifyMailTokenAccount)
18
18
  router.post('/iam/auth/reset/password', auth.resetPassword)
19
19
  router.post('/iam/auth/signup', auth.createCustomer)