@tabletennisshop/common 1.0.49 → 1.0.51
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.
@@ -1,2 +1,2 @@
|
|
1
|
-
import { NextFunction } from "express";
|
1
|
+
import { NextFunction, Request, Response } from "express";
|
2
2
|
export declare const CheckAuthorizedMiddleware: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
@@ -8,17 +8,13 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
8
8
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
9
9
|
});
|
10
10
|
};
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
13
|
-
};
|
14
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
15
12
|
exports.CheckAuthorizedMiddleware = void 0;
|
16
|
-
const axios_1 = __importDefault(require("axios"));
|
17
13
|
const not_authorized_error_1 = require("../errors/not-authorized-error");
|
18
14
|
const CheckAuthorizedMiddleware = (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
|
15
|
+
var _a;
|
19
16
|
//This can be wrong
|
20
|
-
|
21
|
-
if (axiosRes.status != 200) {
|
17
|
+
if (!((_a = req.session) === null || _a === void 0 ? void 0 : _a.jwt)) {
|
22
18
|
throw new not_authorized_error_1.NotAuthorizedError("Not Authorized");
|
23
19
|
}
|
24
20
|
next();
|