powr-sdk-api 2.3.3 → 2.3.5

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.
@@ -7,7 +7,8 @@ const {
7
7
  const config = require('../config');
8
8
  const generateJWTToken = user => {
9
9
  return jwt.sign({
10
- userId: user._id
10
+ userId: user._id,
11
+ fullName: user.fullName
11
12
  }, config.jwtToken, {
12
13
  expiresIn: '24h'
13
14
  });
@@ -34,13 +35,12 @@ const verifyToken = async (req, res, next) => {
34
35
 
35
36
  // Attach user info to request object
36
37
  req.user = {
37
- powrId: new ObjectId(decoded.userId),
38
+ powrId: decoded.userId,
38
39
  // powr-base user ID
39
- access: 1 // Default access level for API users
40
+ fullName: decoded.fullName // User's full name
40
41
  };
41
42
  console.log("Authenticated user:", {
42
- powrId: req.user.powrId,
43
- access: req.user.access
43
+ powrId: req.user.powrId
44
44
  });
45
45
  next();
46
46
  } catch (error) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powr-sdk-api",
3
- "version": "2.3.3",
3
+ "version": "2.3.5",
4
4
  "description": "Shared API core library for PowrStack projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",