@autofleet/zehut 1.7.3-beta2 → 1.7.3-beta4
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.
- package/lib/user/ApiUser.js +1 -1
- package/lib/user/index.js +1 -2
- package/package.json +1 -1
package/lib/user/ApiUser.js
CHANGED
|
@@ -97,7 +97,7 @@ class ApiUser {
|
|
|
97
97
|
getUserAppPermissions(appId) {
|
|
98
98
|
return __awaiter(this, void 0, void 0, function* () {
|
|
99
99
|
console.log('getUserAppPermissions1', appId, this.id);
|
|
100
|
-
if (!this.id || appId) {
|
|
100
|
+
if (!this.id || !appId) {
|
|
101
101
|
return;
|
|
102
102
|
}
|
|
103
103
|
const currentAppPermission = this.appPermission[appId];
|
package/lib/user/index.js
CHANGED
|
@@ -109,7 +109,6 @@ exports.middlewareWithDecode = (options = {}) => (req, res, next) => __awaiter(v
|
|
|
109
109
|
return next();
|
|
110
110
|
});
|
|
111
111
|
exports.appMiddleware = (options) => (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
112
|
-
var _b;
|
|
113
112
|
const { appId, clientSecret, appSecret, } = options;
|
|
114
113
|
const trace = tracer_1.newTrace('userPayload');
|
|
115
114
|
let decoded;
|
|
@@ -140,7 +139,7 @@ exports.appMiddleware = (options) => (req, res, next) => __awaiter(void 0, void
|
|
|
140
139
|
errors: ['Server error while parsing token'],
|
|
141
140
|
});
|
|
142
141
|
}
|
|
143
|
-
const userId =
|
|
142
|
+
const userId = decoded === null || decoded === void 0 ? void 0 : decoded.userId;
|
|
144
143
|
if (userId) {
|
|
145
144
|
req.headers['X-AF-USER-ID'] = userId;
|
|
146
145
|
}
|