@wrcb/cb-common 1.0.85 → 1.0.87

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.
@@ -19,6 +19,7 @@ function signUpReturnCookie(id) {
19
19
  isVerified: true
20
20
  };
21
21
  // Create the JWT
22
+ console.log('JWT_KEY no pacote @wrcb/cb-common:::::::::::', process.env.JWT_KEY);
22
23
  const token = jsonwebtoken_1.default.sign(payload, process.env.JWT_KEY);
23
24
  // Build session object {jwt: MY_JWT}
24
25
  const session = { jwt: token };
@@ -11,10 +11,12 @@ const currentUser = (req, res, next) => {
11
11
  // e setar no currentUser property
12
12
  // se não tiver logado, outro middleware irá retornar um erro.
13
13
  if (!((_a = req.session) === null || _a === void 0 ? void 0 : _a.jwt)) {
14
+ console.log('entrou a qui----');
14
15
  return next();
15
16
  }
16
17
  try {
17
18
  const payload = jsonwebtoken_1.default.verify(req.session.jwt, process.env.JWT_KEY);
19
+ console.log('payload no currentUser', payload);
18
20
  req.currentUser = payload;
19
21
  }
20
22
  catch (error) { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wrcb/cb-common",
3
- "version": "1.0.85",
3
+ "version": "1.0.87",
4
4
  "description": "Common resources between services",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",