@ticketsnav/common 1.0.3 → 1.0.6

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.
@@ -10,5 +10,5 @@ declare global {
10
10
  }
11
11
  }
12
12
  }
13
- export declare const currentUser: (req: Request, res: Response, next: NextFunction) => Response<any, Record<string, any>>;
13
+ export declare const currentUser: (req: Request, res: Response, next: NextFunction) => void;
14
14
  export {};
@@ -5,10 +5,11 @@ const jwt = require("jsonwebtoken");
5
5
  const currentUser = (req, res, next) => {
6
6
  var _a;
7
7
  if (!((_a = req.session) === null || _a === void 0 ? void 0 : _a.jwt)) {
8
- return res.send({ currentUser: null });
8
+ return next();
9
9
  }
10
10
  try {
11
11
  const payload = jwt.verify(req.session.jwt, process.env.JWT_KEY);
12
+ console.log(req.currentUser);
12
13
  req.currentUser = payload;
13
14
  }
14
15
  catch (err) { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ticketsnav/common",
3
- "version": "1.0.3",
3
+ "version": "1.0.6",
4
4
  "main": "./build/index.js",
5
5
  "types": "./build/index.d.ts",
6
6
  "files": [