nhb-toolbox 4.30.16 → 4.30.20

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/CHANGELOG.md CHANGED
@@ -4,6 +4,10 @@
4
4
 
5
5
  All notable changes to the package will be documented here.
6
6
 
7
+ ## [4.30.20] - 2026-05-26
8
+
9
+ - **Fixed** token audience(s) validation issue in `Signet` class.
10
+
7
11
  ## [4.30.16] - 2026-05-24
8
12
 
9
13
  - **Fixed** multiple issues with `createFormData`: Now handles configuration options properly and it is more reliable now.
@@ -114,7 +114,7 @@ class Signet {
114
114
  return false;
115
115
  const payloadAud = Array.isArray(aud) ? aud : [aud];
116
116
  const expectedAud = Array.isArray(expected) ? expected : [expected];
117
- return payloadAud.some((tokenAud) => expectedAud.includes(tokenAud));
117
+ return !payloadAud.some((tokenAud) => expectedAud.includes(tokenAud));
118
118
  }
119
119
  isInvalidSubject(token, expected) {
120
120
  if (!expected)
@@ -141,7 +141,7 @@ class Signet {
141
141
  throw new Error('Invalid token issuer!');
142
142
  }
143
143
  if (this.isInvalidAudience(token, audience)) {
144
- throw new Error('Invalid token audience(s!');
144
+ throw new Error('Invalid token audience(s)!');
145
145
  }
146
146
  if (this.isInvalidSubject(token, subject)) {
147
147
  throw new Error('Invalid token subject!');
@@ -111,7 +111,7 @@ export class Signet {
111
111
  return false;
112
112
  const payloadAud = Array.isArray(aud) ? aud : [aud];
113
113
  const expectedAud = Array.isArray(expected) ? expected : [expected];
114
- return payloadAud.some((tokenAud) => expectedAud.includes(tokenAud));
114
+ return !payloadAud.some((tokenAud) => expectedAud.includes(tokenAud));
115
115
  }
116
116
  isInvalidSubject(token, expected) {
117
117
  if (!expected)
@@ -138,7 +138,7 @@ export class Signet {
138
138
  throw new Error('Invalid token issuer!');
139
139
  }
140
140
  if (this.isInvalidAudience(token, audience)) {
141
- throw new Error('Invalid token audience(s!');
141
+ throw new Error('Invalid token audience(s)!');
142
142
  }
143
143
  if (this.isInvalidSubject(token, subject)) {
144
144
  throw new Error('Invalid token subject!');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "nhb-toolbox",
3
- "version": "4.30.16",
3
+ "version": "4.30.20",
4
4
  "description": "A versatile collection of smart, efficient, and reusable utility functions, classes and types for everyday development needs.",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",