joye-backend-utility 4.1.22-test13 → 4.1.22-test14

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.
Files changed (2) hide show
  1. package/dist/jwt.js +2 -2
  2. package/package.json +1 -1
package/dist/jwt.js CHANGED
@@ -4,12 +4,12 @@ exports.jwtVerify = exports.createToken = void 0;
4
4
  const jwt = require('jsonwebtoken');
5
5
  const fs = require('fs');
6
6
  const path = require('path');
7
- const JWT_SECRET = '64d5f73bb3f132821122d68330263edd44023810a1f05efb701fc7ec8d0f6382';
7
+ // const JWT_SECRET = '64d5f73bb3f132821122d68330263edd44023810a1f05efb701fc7ec8d0f6382';
8
8
  const folderPath = path.resolve(`${__dirname}`);
9
9
  const JWT_PRIVATE_KEY = fs.readFileSync(`${folderPath}/jwtKeys/jwtRS256.key`, 'utf8');
10
10
  const JWT_PUBLIC_KEY = fs.readFileSync(`${folderPath}/jwtKeys/jwtRS256.key.pub`, 'utf8');
11
11
  const createToken = async (payload, expiresIn) => {
12
- const token = jwt.sign(payload, { key: JWT_PRIVATE_KEY.replace(/\\n/gm, '\n'), passphrase: JWT_SECRET }, {
12
+ const token = jwt.sign(payload, { key: JWT_PRIVATE_KEY.replace(/\\n/gm, '\n'), passphrase: process.env.JWT_SECRET }, {
13
13
  expiresIn,
14
14
  algorithm: 'RS256',
15
15
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "joye-backend-utility",
3
- "version": "4.1.22-test13",
3
+ "version": "4.1.22-test14",
4
4
  "description": "Joye backend utility for db functions and common functions",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",