aloux-iam 0.0.123 → 0.0.124

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.
@@ -6,14 +6,12 @@ const self = module.exports;
6
6
  self.email = async (req, res) => {
7
7
  try {
8
8
  const response = await Auth.searchEmail(req.body.email, req.body.code);
9
- res
10
- .status(response.statusCode)
11
- .send({
12
- email: response.email,
13
- _id: response._id,
14
- name: response.name,
15
- lastName: response.lastName,
16
- });
9
+ res.status(response.statusCode).send({
10
+ email: response.email,
11
+ _id: response._id,
12
+ name: response.name,
13
+ lastName: response.lastName,
14
+ });
17
15
  } catch (error) {
18
16
  await utils.responseError(res, error);
19
17
  }
@@ -30,7 +28,7 @@ self.login = async (req, res) => {
30
28
 
31
29
  self.logo = async (req, res) => {
32
30
  try {
33
- const response = await Auth.logo(req.body, res);
31
+ const response = await Auth.logo(req.body.email);
34
32
  res.status(200).send(response);
35
33
  } catch (error) {
36
34
  await utils.responseError(res, error);
@@ -205,10 +205,8 @@ self.login = async (body, res) => {
205
205
  }
206
206
  };
207
207
 
208
- self.logo = async (body, res) => {
209
- const user = await User.findOne({ _id: req.user._id })
210
- .populate("_company")
211
- .lean();
208
+ self.logo = async (email) => {
209
+ const user = await User.findOne({ email: email }).populate("_company").lean();
212
210
  if (user._company.length === 1) {
213
211
  return { logo: user._company[0].imgUrl };
214
212
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aloux-iam",
3
- "version": "0.0.123",
3
+ "version": "0.0.124",
4
4
  "description": "Aloux IAM for APIs ",
5
5
  "main": "index.js",
6
6
  "scripts": {