Skip to content

Commit 7671821

Browse files
committed
Bug fixes
1 parent 63a80c3 commit 7671821

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

package-lock.json

Lines changed: 5 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nasriya/authcrypto",
3-
"version": "1.1.1",
3+
"version": "1.1.2",
44
"description": "AuthCrypto is a versatile cryptographic toolkit for handling JSON Web Tokens (JWT), password hashing, and secure token generation and verification. It provides robust methods for creating and managing JWTs, hashing and verifying passwords with secure algorithms, and generating cryptographically strong random values for various use cases.",
55
"main": "./dist/cjs/manager.js",
66
"module": "./dist/esm/manager.js",

src/assets/config/config.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class ConfigManager {
101101
set maxPasswordLength(max: number) {
102102
if (!Number.isInteger(max)) { throw new TypeError('The max password length must be a valid number and cannot be greater than 32') }
103103
if (max < 8) { throw new RangeError('The max password length cannot be less than 8') }
104-
if (this.minPasswordLength && max > this.minPasswordLength) { throw new RangeError('The max password length cannot be greater than the min password length') }
104+
if (this.minPasswordLength && max < this.minPasswordLength) { throw new RangeError('The max password length cannot be less than the min password length') }
105105
process.env.AuthCrypto_PASSWORDS_MAX = max.toString();
106106
}
107107

@@ -135,9 +135,9 @@ class ConfigManager {
135135
if (typeof secret !== 'string') { throw new TypeError('The JWT secret must be a string') }
136136

137137
const keyBytes = Buffer.byteLength(secret, 'utf8');
138-
if (keyBytes < 64) { throw new Error(`The "AuthCrypto_JWT_SECRET" key must be at least 64 bytes long for HS512. Found: ${keyBytes} bytes.`); }
138+
if (keyBytes < 64) { throw new Error(`The "AuthCrypto_SECRET" key must be at least 64 bytes long for HS512. Found: ${keyBytes} bytes.`); }
139139

140-
process.env.AuthCrypto_JWT_SECRET = secret;
140+
process.env.AuthCrypto_SECRET = secret;
141141
}
142142

143143
/**

0 commit comments

Comments
 (0)