apeframework 0.0.0-dev.4 → 0.0.0-dev.6
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 +2 -6
- package/pwd/Pwd.js +3 -3
- package/pwd/Pwd.ts +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apeframework",
|
|
3
|
-
"version": "0.0.0-dev.
|
|
3
|
+
"version": "0.0.0-dev.6",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"author": "Matthieu Symoens",
|
|
6
6
|
"description": "Node.js app framework",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@fastify/cors": "^9.0",
|
|
26
26
|
"@fastify/response-validation": "^2.6",
|
|
27
27
|
"@fastify/swagger": "^8.15",
|
|
28
|
-
"
|
|
28
|
+
"bcryptjs": "^2.4",
|
|
29
29
|
"bullmq": "^5.12",
|
|
30
30
|
"dotenv": "^16.4",
|
|
31
31
|
"fastify": "^4.28",
|
|
@@ -33,14 +33,10 @@
|
|
|
33
33
|
"ical-generator": "^8.0",
|
|
34
34
|
"ioredis": "^5.4",
|
|
35
35
|
"jose": "^5.8",
|
|
36
|
-
"knex": "^3.1",
|
|
37
|
-
"mysql2": "^3.11",
|
|
38
36
|
"nodemailer": "^6.9",
|
|
39
37
|
"openapi-types": "^12.1",
|
|
40
|
-
"pg": "^8.12",
|
|
41
38
|
"pino": "^9.4",
|
|
42
39
|
"pino-pretty": "^11.2",
|
|
43
|
-
"sqlite3": "^5.1",
|
|
44
40
|
"yargs-parser": "^21.1"
|
|
45
41
|
},
|
|
46
42
|
"peerDependencies": {
|
package/pwd/Pwd.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.Pwd = void 0;
|
|
7
|
-
const
|
|
7
|
+
const bcryptjs_1 = __importDefault(require("bcryptjs"));
|
|
8
8
|
const validateHashRounds_1 = require("./validateHashRounds");
|
|
9
9
|
class Pwd {
|
|
10
10
|
hashRounds;
|
|
@@ -13,10 +13,10 @@ class Pwd {
|
|
|
13
13
|
this.hashRounds = params.hashRounds;
|
|
14
14
|
}
|
|
15
15
|
async hashPassword(password) {
|
|
16
|
-
return
|
|
16
|
+
return bcryptjs_1.default.hashSync(password, this.hashRounds);
|
|
17
17
|
}
|
|
18
18
|
async verifyPassword(password, hash) {
|
|
19
|
-
return
|
|
19
|
+
return bcryptjs_1.default.compareSync(password, hash);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
22
|
exports.Pwd = Pwd;
|
package/pwd/Pwd.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import bcrypt from '
|
|
1
|
+
import bcrypt from 'bcryptjs'
|
|
2
2
|
import { validateHashRounds } from './validateHashRounds'
|
|
3
3
|
|
|
4
4
|
class Pwd {
|
|
@@ -15,14 +15,14 @@ class Pwd {
|
|
|
15
15
|
public async hashPassword(
|
|
16
16
|
password: string,
|
|
17
17
|
): Promise<string> {
|
|
18
|
-
return bcrypt.
|
|
18
|
+
return bcrypt.hashSync(password, this.hashRounds)
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
public async verifyPassword(
|
|
22
22
|
password: string,
|
|
23
23
|
hash: string,
|
|
24
24
|
): Promise<boolean> {
|
|
25
|
-
return bcrypt.
|
|
25
|
+
return bcrypt.compareSync(password, hash)
|
|
26
26
|
}
|
|
27
27
|
}
|
|
28
28
|
|