@lenne.tech/nest-server 8.6.26 → 8.6.27

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lenne.tech/nest-server",
3
- "version": "8.6.26",
3
+ "version": "8.6.27",
4
4
  "description": "Modern, fast, powerful Node.js web framework in TypeScript based on Nest with a GraphQL API and a connection to MongoDB (or other databases).",
5
5
  "keywords": [
6
6
  "node",
@@ -82,7 +82,7 @@
82
82
  "light-my-request": "5.0.0",
83
83
  "lodash": "4.17.21",
84
84
  "mongodb": "4.7.0",
85
- "mongoose": "6.4.1",
85
+ "mongoose": "6.4.2",
86
86
  "mongoose-gridfs": "1.3.0",
87
87
  "multer": "1.4.5-lts.1",
88
88
  "node-mailjet": "5.0.1",
@@ -101,14 +101,14 @@
101
101
  "@types/jest": "28.1.4",
102
102
  "@types/lodash": "4.14.182",
103
103
  "@types/multer": "1.4.7",
104
- "@types/node": "18.0.0",
104
+ "@types/node": "18.0.1",
105
105
  "@types/nodemailer": "6.4.4",
106
106
  "@types/passport": "1.0.9",
107
107
  "@types/supertest": "2.0.12",
108
- "@typescript-eslint/eslint-plugin": "5.30.0",
109
- "@typescript-eslint/parser": "5.30.0",
108
+ "@typescript-eslint/eslint-plugin": "5.30.4",
109
+ "@typescript-eslint/parser": "5.30.4",
110
110
  "coffeescript": "2.7.0",
111
- "eslint": "8.18.0",
111
+ "eslint": "8.19.0",
112
112
  "eslint-config-prettier": "8.5.0",
113
113
  "find-file-up": "2.0.1",
114
114
  "grunt": "1.5.3",
@@ -121,10 +121,10 @@
121
121
  "pm2": "5.2.0",
122
122
  "prettier": "2.7.1",
123
123
  "pretty-quick": "3.1.3",
124
- "supertest": "6.2.3",
124
+ "supertest": "6.2.4",
125
125
  "ts-jest": "28.0.5",
126
126
  "ts-morph": "15.1.0",
127
- "ts-node": "10.8.1",
127
+ "ts-node": "10.8.2",
128
128
  "tsconfig-paths": "4.0.0",
129
129
  "typescript": "4.7.4"
130
130
  },
@@ -134,10 +134,9 @@ export async function prepareInput<T = any>(
134
134
  if ((input as any).password) {
135
135
  // Check if the password was transmitted encrypted
136
136
  // If not, the password is encrypted to enable future encrypted and unencrypted transmissions
137
- (input as any).password =
138
- !envConfig.sha256 || /^[a-f0-9]{64}$/i.test((input as any).password)
139
- ? (input as any).password
140
- : sha256((input as any).password);
137
+ if (envConfig.sha256 && !/^[a-f0-9]{64}$/i.test((input as any).password)) {
138
+ (input as any).password = sha256((input as any).password);
139
+ }
141
140
 
142
141
  // Hash password
143
142
  (input as any).password = await bcrypt.hash((input as any).password, 10);
@@ -4,7 +4,6 @@ import { JwtModuleOptions } from '@nestjs/jwt';
4
4
  import { MongooseModuleOptions } from '@nestjs/mongoose';
5
5
  import { ServeStaticOptions } from '@nestjs/platform-express/interfaces/serve-static-options.interface';
6
6
  import { CronExpression } from '@nestjs/schedule';
7
- import { sha256 } from 'js-sha256';
8
7
  import * as SMTPTransport from 'nodemailer/lib/smtp-transport';
9
8
  import { Falsy } from '../types/falsy.type';
10
9
  import { CronJobConfig } from './cron-job-config.interface';
@@ -132,7 +132,9 @@ export abstract class CoreUserService<
132
132
  async () => {
133
133
  // Check if the password was transmitted encrypted
134
134
  // If not, the password is encrypted to enable future encrypted and unencrypted transmissions
135
- newPassword = !envConfig.sha256 || /^[a-f0-9]{64}$/i.test(newPassword) ? newPassword : sha256(newPassword);
135
+ if (envConfig.sha256 && !/^[a-f0-9]{64}$/i.test(newPassword)) {
136
+ newPassword = sha256(newPassword);
137
+ }
136
138
 
137
139
  // Update and return user
138
140
  return await assignPlain(dbObject, {