dms-middleware-auth 1.0.1 → 1.0.2

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.
@@ -101,7 +101,10 @@ let AuthMiddleware = class AuthMiddleware {
101
101
 
102
102
  // Attach attributes to request
103
103
  userAttributes = JSON.parse(userAttributes);*/
104
- req['role'] = role;
104
+ req['user'] = {
105
+ role: role,
106
+ userName: decoded.payload.email
107
+ };
105
108
  // req['attributes'] = {
106
109
  // client: clientAttributes[req.originalUrl],
107
110
  // // user: userAttributes,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dms-middleware-auth",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Reusable middleware for authentication and authorization in NestJS applications.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -72,7 +72,11 @@ export class AuthMiddleware implements NestMiddleware {
72
72
 
73
73
  // Attach attributes to request
74
74
  userAttributes = JSON.parse(userAttributes);*/
75
- req['role'] = role;
75
+ req['user'] = {
76
+ role: role,
77
+ userName:decoded.payload.email
78
+ };
79
+
76
80
  // req['attributes'] = {
77
81
  // client: clientAttributes[req.originalUrl],
78
82
  // // user: userAttributes,