not-node 6.1.8 → 6.1.9

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": "not-node",
3
- "version": "6.1.8",
3
+ "version": "6.1.9",
4
4
  "description": "node complimentary part for client side notFramework.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -22,16 +22,16 @@ class Identity {
22
22
 
23
23
  static setPrimaryRoles(list = []) {
24
24
  this.#primaryRoles = [...list];
25
- this.#providers.forEach((itm) => {
26
- itm.setPrimaryRoles([...list]);
25
+ Object.keys(this.#providers).forEach((itm) => {
26
+ this.#providers[itm].setPrimaryRoles([...list]);
27
27
  });
28
28
  return this;
29
29
  }
30
30
 
31
31
  static setSecondaryRoles(list = []) {
32
32
  this.#secondaryRoles = [...list];
33
- this.#providers.forEach((itm) => {
34
- itm.setSecondaryRoles([...list]);
33
+ Object.keys(this.#providers).forEach((itm) => {
34
+ this.#providers[itm].setSecondaryRoles([...list]);
35
35
  });
36
36
  return this;
37
37
  }
@@ -13,11 +13,11 @@ module.exports = class IdentityProviderSession {
13
13
  }
14
14
 
15
15
  static setPrimaryRoles(list = []) {
16
- this.#options.primaryRoles = list;
16
+ IdentityProviderSession.#getOptions().primaryRoles = [...list];
17
17
  }
18
18
 
19
19
  static setSecondaryRoles(list = []) {
20
- this.#options.secondaryRoles = list;
20
+ IdentityProviderSession.#getOptions().secondaryRoles = [...list];
21
21
  }
22
22
 
23
23
  constructor(req) {
@@ -42,7 +42,11 @@ module.exports = class IdentityProviderSession {
42
42
  getPrimaryRole() {
43
43
  const roles = this.getRole();
44
44
  for (let role of roles) {
45
- if (this.#options.primaryRoles.includes(role)) {
45
+ if (
46
+ IdentityProviderSession.#getOptions().primaryRoles.includes(
47
+ role
48
+ )
49
+ ) {
46
50
  return role;
47
51
  }
48
52
  }
@@ -22,11 +22,11 @@ module.exports = class IdentityProviderToken {
22
22
  }
23
23
 
24
24
  static setPrimaryRoles(list = []) {
25
- this.#options.primaryRoles = list;
25
+ IdentityProviderToken.#getOptions().primaryRoles = [...list];
26
26
  }
27
27
 
28
28
  static setSecondaryRoles(list = []) {
29
- this.#options.secondaryRoles = list;
29
+ IdentityProviderToken.#getOptions().secondaryRoles = [...list];
30
30
  }
31
31
 
32
32
  constructor(req) {
@@ -186,7 +186,9 @@ module.exports = class IdentityProviderToken {
186
186
  getPrimaryRole() {
187
187
  const roles = this.getRole();
188
188
  for (let role of roles) {
189
- if (this.#options.primaryRoles.includes(role)) {
189
+ if (
190
+ IdentityProviderToken.#getOptions().primaryRoles.includes(role)
191
+ ) {
190
192
  return role;
191
193
  }
192
194
  }