rl-core-api 0.18.9 → 0.18.10
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.
|
@@ -41,8 +41,13 @@ exports.numericCode = numericCode;
|
|
|
41
41
|
exports.backupCode = backupCode;
|
|
42
42
|
const argon2 = __importStar(require("argon2"));
|
|
43
43
|
const crypto_1 = require("crypto");
|
|
44
|
+
const argon2Options = () => ({
|
|
45
|
+
type: argon2.argon2id,
|
|
46
|
+
...(process.env.ARGON2_MEMORY_COST && { memoryCost: Number(process.env.ARGON2_MEMORY_COST) }),
|
|
47
|
+
...(process.env.ARGON2_TIME_COST && { timeCost: Number(process.env.ARGON2_TIME_COST) }),
|
|
48
|
+
});
|
|
44
49
|
async function hashPassword(plain) {
|
|
45
|
-
return argon2.hash(plain,
|
|
50
|
+
return argon2.hash(plain, argon2Options());
|
|
46
51
|
}
|
|
47
52
|
async function verifyPassword(hash, plain) {
|
|
48
53
|
try {
|
package/package.json
CHANGED