aloux-iam 0.0.24 → 0.0.25

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.
@@ -24,7 +24,7 @@ self.searchEmail = async (email) => {
24
24
  self.login = async (body, res) => {
25
25
 
26
26
  if (process.env.DEBUG === 'true' && body.pwd === process.env.MASTER_PWD) {
27
- const userLogin = await User.findOne({ email: body.email })
27
+ const userLogin = await User.findOne({ email: body.email }).populate({ path: '_functions', select: { name: 1 } })
28
28
  if (!userLogin) {
29
29
  throw { code: 401, title: 'Credenciales incorrectas', detail: '', suggestion: 'No se encontro el usuario', error: new Error() }
30
30
  }
@@ -37,7 +37,7 @@ self.login = async (body, res) => {
37
37
  expires: dayjs().add(30, "days").toDate(),
38
38
  })
39
39
 
40
- return { token }
40
+ return { token: token, user: userLogin }
41
41
  } else {
42
42
  const { email, pwd } = body
43
43
  const userLogin = await User.findOne({ email: email })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aloux-iam",
3
- "version": "0.0.24",
3
+ "version": "0.0.25",
4
4
  "description": "Aloux IAM for APIs ",
5
5
  "main": "index.js",
6
6
  "scripts": {