@autofleet/zehut 1.8.1-beta1 → 1.8.1-beta3
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/index.d.ts +1 -0
- package/lib/user/index.d.ts +1 -0
- package/lib/user/index.js +1 -2
- package/package.json +1 -1
package/lib/index.d.ts
CHANGED
package/lib/user/index.d.ts
CHANGED
|
@@ -11,6 +11,7 @@ export declare const middlewareWithDecode: (options?: {
|
|
|
11
11
|
}) => (req: any, res: any, next: any) => Promise<void>;
|
|
12
12
|
export declare const appMiddleware: (options: {
|
|
13
13
|
appId: string;
|
|
14
|
+
clientSecret: string;
|
|
14
15
|
}) => (req: any, res: any, next: any) => Promise<void>;
|
|
15
16
|
export declare const eagerLoadPermissionsMiddleware: (req: any, res: any, next: any) => Promise<any>;
|
|
16
17
|
export declare const getDecodedBearer: (req: any) => any;
|
package/lib/user/index.js
CHANGED
|
@@ -123,7 +123,7 @@ exports.middlewareWithDecode = (options = {}) => (req, res, next) => __awaiter(v
|
|
|
123
123
|
return next();
|
|
124
124
|
});
|
|
125
125
|
exports.appMiddleware = (options) => (req, res, next) => __awaiter(void 0, void 0, void 0, function* () {
|
|
126
|
-
const { appId, } = options;
|
|
126
|
+
const { appId, clientSecret, } = options;
|
|
127
127
|
const trace = tracer_1.newTrace('userPayload');
|
|
128
128
|
let decoded;
|
|
129
129
|
if (!req.headers.authorization) {
|
|
@@ -168,7 +168,6 @@ exports.appMiddleware = (options) => (req, res, next) => __awaiter(void 0, void
|
|
|
168
168
|
}
|
|
169
169
|
const userObject = new ApiUser_1.default(userId);
|
|
170
170
|
if (appId) {
|
|
171
|
-
const clientSecret = yield app_auth_1.getClientSecret(appId);
|
|
172
171
|
req.headers['x-autofleet-apps-secret'] = clientSecret;
|
|
173
172
|
// Won't work until we find a better solution for identity ms
|
|
174
173
|
yield userObject.getUserAppPermissions(appId, clientSecret);
|