@devline-smart-taxi/common 2.3.72 → 2.3.73
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.
|
@@ -5,10 +5,12 @@ const common_1 = require("@nestjs/common");
|
|
|
5
5
|
exports.CurrentUser = (0, common_1.createParamDecorator)((data, context) => {
|
|
6
6
|
// gRPC metadatasini olish
|
|
7
7
|
const metadata = context.switchToRpc().getContext();
|
|
8
|
-
//
|
|
8
|
+
// Canonical keys are user-*.
|
|
9
|
+
const id = metadata.get('user-id')?.[0];
|
|
10
|
+
const role = metadata.get('user-role')?.[0];
|
|
9
11
|
const user = {
|
|
10
|
-
id
|
|
11
|
-
role
|
|
12
|
+
id,
|
|
13
|
+
role,
|
|
12
14
|
};
|
|
13
15
|
return data ? user?.[data] : user;
|
|
14
16
|
});
|