@ajayjbtickets/common 1.0.14 → 1.0.15

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/dist/index.cjs CHANGED
@@ -420,10 +420,10 @@ var JwtService = class {
420
420
  );
421
421
  return decoded;
422
422
  }
423
- static generatePayload(user) {
423
+ static generatePayload(payload) {
424
424
  return {
425
- _id: user._id.toString(),
426
- email: user.email
425
+ id: payload.id,
426
+ email: payload.email
427
427
  };
428
428
  }
429
429
  };
package/dist/index.d.cts CHANGED
@@ -159,13 +159,13 @@ declare const schemaValidator: (type: ValidationSource, schema: ZodSchema) => (r
159
159
  declare const verifyToken: (req: Request, res: Response, next: NextFunction) => Promise<void>;
160
160
 
161
161
  interface JwtPayload {
162
- _id: string;
162
+ id: string;
163
163
  email: string;
164
164
  }
165
165
  declare class JwtService {
166
166
  static sign(payload: string | Buffer | object, signOptions?: SignOptions): string;
167
167
  static verify(token: string, verifyOptions?: VerifyOptions): string | jsonwebtoken.Jwt | jsonwebtoken.JwtPayload;
168
- static generatePayload<T extends JwtPayload>(user: T): T;
168
+ static generatePayload<T extends JwtPayload>(payload: T): T;
169
169
  }
170
170
 
171
171
  declare class Password {
package/dist/index.d.ts CHANGED
@@ -159,13 +159,13 @@ declare const schemaValidator: (type: ValidationSource, schema: ZodSchema) => (r
159
159
  declare const verifyToken: (req: Request, res: Response, next: NextFunction) => Promise<void>;
160
160
 
161
161
  interface JwtPayload {
162
- _id: string;
162
+ id: string;
163
163
  email: string;
164
164
  }
165
165
  declare class JwtService {
166
166
  static sign(payload: string | Buffer | object, signOptions?: SignOptions): string;
167
167
  static verify(token: string, verifyOptions?: VerifyOptions): string | jsonwebtoken.Jwt | jsonwebtoken.JwtPayload;
168
- static generatePayload<T extends JwtPayload>(user: T): T;
168
+ static generatePayload<T extends JwtPayload>(payload: T): T;
169
169
  }
170
170
 
171
171
  declare class Password {
package/dist/index.js CHANGED
@@ -354,10 +354,10 @@ var JwtService = class {
354
354
  );
355
355
  return decoded;
356
356
  }
357
- static generatePayload(user) {
357
+ static generatePayload(payload) {
358
358
  return {
359
- _id: user._id.toString(),
360
- email: user.email
359
+ id: payload.id,
360
+ email: payload.email
361
361
  };
362
362
  }
363
363
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ajayjbtickets/common",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",