@loomcore/api 0.0.30 → 0.0.31

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.
@@ -22,6 +22,7 @@ export class AuthService extends GenericApiService {
22
22
  async attemptLogin(req, res, email, password) {
23
23
  const lowerCaseEmail = email.toLowerCase();
24
24
  const user = await this.getUserByEmail(lowerCaseEmail);
25
+ console.log(`In attemptLogin, user: ${JSON.stringify(user)}`);
25
26
  if (!user) {
26
27
  throw new BadRequestError('Invalid Credentials');
27
28
  }
@@ -33,6 +34,7 @@ export class AuthService extends GenericApiService {
33
34
  user: user,
34
35
  _orgId: user._orgId
35
36
  };
37
+ console.log(`In attemptLogin, userContext: ${JSON.stringify(userContext)}`);
36
38
  const deviceId = this.getAndSetDeviceIdCookie(req, res);
37
39
  const loginResponse = await this.logUserIn(userContext, deviceId);
38
40
  return loginResponse;
@@ -51,7 +53,8 @@ export class AuthService extends GenericApiService {
51
53
  };
52
54
  this.updateLastLoggedIn(userContext.user._id)
53
55
  .catch(err => console.log(`Error updating lastLoggedIn: ${err}`));
54
- this.transformSingle(userContext.user);
56
+ userContext.user = this.transformSingle(userContext.user);
57
+ console.log(`In logUserIn, userContext: ${JSON.stringify(userContext)}`);
55
58
  loginResponse = { tokens: tokenResponse, userContext };
56
59
  }
57
60
  return loginResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@loomcore/api",
3
- "version": "0.0.30",
3
+ "version": "0.0.31",
4
4
  "private": false,
5
5
  "description": "Loom Core Api - An opinionated Node.js api using Typescript, Express, and MongoDb",
6
6
  "scripts": {