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
package/src/identity/identity.js
CHANGED
|
@@ -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
|
-
|
|
16
|
+
IdentityProviderSession.#getOptions().primaryRoles = [...list];
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
static setSecondaryRoles(list = []) {
|
|
20
|
-
|
|
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 (
|
|
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
|
-
|
|
25
|
+
IdentityProviderToken.#getOptions().primaryRoles = [...list];
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
static setSecondaryRoles(list = []) {
|
|
29
|
-
|
|
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 (
|
|
189
|
+
if (
|
|
190
|
+
IdentityProviderToken.#getOptions().primaryRoles.includes(role)
|
|
191
|
+
) {
|
|
190
192
|
return role;
|
|
191
193
|
}
|
|
192
194
|
}
|