@axa-fr/oidc-client 7.22.18 → 7.22.19
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/README.md +31 -39
- package/bin/copy-service-worker-files.mjs +24 -17
- package/dist/OidcTrustedDomains.js +14 -12
- package/dist/cache.d.ts.map +1 -1
- package/dist/checkSession.d.ts +1 -1
- package/dist/checkSession.d.ts.map +1 -1
- package/dist/checkSessionIFrame.d.ts.map +1 -1
- package/dist/crypto.d.ts.map +1 -1
- package/dist/fetch.d.ts +2 -1
- package/dist/fetch.d.ts.map +1 -1
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +935 -601
- package/dist/index.umd.cjs +2 -2
- package/dist/initSession.d.ts +1 -1
- package/dist/initSession.d.ts.map +1 -1
- package/dist/initWorker.d.ts +2 -2
- package/dist/initWorker.d.ts.map +1 -1
- package/dist/initWorkerOption.d.ts.map +1 -1
- package/dist/jwt.d.ts +2 -2
- package/dist/jwt.d.ts.map +1 -1
- package/dist/keepSession.d.ts.map +1 -1
- package/dist/location.d.ts.map +1 -1
- package/dist/login.d.ts +1 -1
- package/dist/login.d.ts.map +1 -1
- package/dist/logout.d.ts +1 -1
- package/dist/logout.d.ts.map +1 -1
- package/dist/oidc.d.ts +1 -1
- package/dist/oidc.d.ts.map +1 -1
- package/dist/oidcClient.d.ts +2 -2
- package/dist/oidcClient.d.ts.map +1 -1
- package/dist/parseTokens.d.ts.map +1 -1
- package/dist/renewTokens.d.ts.map +1 -1
- package/dist/requests.d.ts +1 -1
- package/dist/requests.d.ts.map +1 -1
- package/dist/silentLogin.d.ts.map +1 -1
- package/dist/timer.d.ts.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/user.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +2 -2
- package/src/cache.ts +21 -18
- package/src/checkSession.ts +89 -54
- package/src/checkSessionIFrame.ts +70 -69
- package/src/crypto.ts +27 -25
- package/src/events.ts +28 -28
- package/src/fetch.ts +40 -21
- package/src/index.ts +6 -17
- package/src/iniWorker.spec.ts +26 -16
- package/src/initSession.ts +115 -113
- package/src/initWorker.ts +299 -212
- package/src/initWorkerOption.ts +121 -114
- package/src/jwt.ts +150 -136
- package/src/keepSession.ts +100 -81
- package/src/location.ts +24 -26
- package/src/login.ts +246 -189
- package/src/logout.spec.ts +131 -76
- package/src/logout.ts +130 -115
- package/src/oidc.ts +426 -337
- package/src/oidcClient.ts +129 -105
- package/src/parseTokens.spec.ts +198 -179
- package/src/parseTokens.ts +221 -186
- package/src/renewTokens.ts +397 -284
- package/src/requests.spec.ts +5 -7
- package/src/requests.ts +142 -114
- package/src/route-utils.spec.ts +17 -19
- package/src/route-utils.ts +29 -26
- package/src/silentLogin.ts +145 -127
- package/src/timer.ts +10 -11
- package/src/types.ts +56 -46
- package/src/user.ts +17 -12
- package/src/version.ts +1 -1
package/src/logout.spec.ts
CHANGED
|
@@ -2,85 +2,140 @@
|
|
|
2
2
|
|
|
3
3
|
import { describe, expect, it, vi } from 'vitest';
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { ILOidcLocation } from './location';
|
|
6
|
+
import { logoutAsync } from './logout';
|
|
7
7
|
|
|
8
8
|
describe('Logout test suite', () => {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
9
|
+
const expectedFinalUrl =
|
|
10
|
+
'http://api/connect/endsession?id_token_hint=abcd&post_logout_redirect_uri=http%3A%2F%2Flocalhost%3A4200%2Flogged_out';
|
|
11
|
+
it.each([
|
|
12
|
+
{
|
|
13
|
+
logout_tokens_to_invalidate: ['access_token', 'refresh_token'],
|
|
14
|
+
extras: null,
|
|
15
|
+
expectedResults: [
|
|
16
|
+
'token=abcd&token_type_hint=access_token&client_id=interactive.public.short',
|
|
17
|
+
'token=abdc&token_type_hint=refresh_token&client_id=interactive.public.short',
|
|
18
|
+
],
|
|
19
|
+
expectedFinalUrl,
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
logout_tokens_to_invalidate: ['refresh_token'],
|
|
23
|
+
extras: null,
|
|
24
|
+
expectedResults: [
|
|
25
|
+
'token=abdc&token_type_hint=refresh_token&client_id=interactive.public.short',
|
|
26
|
+
],
|
|
27
|
+
expectedFinalUrl,
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
logout_tokens_to_invalidate: ['access_token'],
|
|
31
|
+
extras: null,
|
|
32
|
+
expectedResults: [
|
|
33
|
+
'token=abcd&token_type_hint=access_token&client_id=interactive.public.short',
|
|
34
|
+
],
|
|
35
|
+
expectedFinalUrl,
|
|
36
|
+
},
|
|
37
|
+
{ logout_tokens_to_invalidate: [], extras: null, expectedResults: [], expectedFinalUrl },
|
|
38
|
+
{
|
|
39
|
+
logout_tokens_to_invalidate: [],
|
|
40
|
+
extras: { id_token_hint: undefined },
|
|
41
|
+
expectedResults: [],
|
|
42
|
+
expectedFinalUrl:
|
|
43
|
+
'http://api/connect/endsession?post_logout_redirect_uri=http%3A%2F%2Flocalhost%3A4200%2Flogged_out',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
logout_tokens_to_invalidate: [],
|
|
47
|
+
extras: { 'no_reload:oidc': 'true' },
|
|
48
|
+
expectedResults: [],
|
|
49
|
+
expectedFinalUrl: '',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
logout_tokens_to_invalidate: ['refresh_token'],
|
|
53
|
+
extras: { 'client_secret:revoke_refresh_token': 'secret' },
|
|
54
|
+
expectedResults: [
|
|
55
|
+
'token=abdc&token_type_hint=refresh_token&client_id=interactive.public.short&client_secret=secret',
|
|
56
|
+
],
|
|
57
|
+
expectedFinalUrl,
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
logout_tokens_to_invalidate: ['access_token'],
|
|
61
|
+
extras: { 'client_secret:revoke_access_token': 'secret' },
|
|
62
|
+
expectedResults: [
|
|
63
|
+
'token=abcd&token_type_hint=access_token&client_id=interactive.public.short&client_secret=secret',
|
|
64
|
+
],
|
|
65
|
+
expectedFinalUrl,
|
|
66
|
+
},
|
|
67
|
+
])(
|
|
68
|
+
'Logout should revoke tokens $logout_tokens_to_invalidate',
|
|
69
|
+
async ({ logout_tokens_to_invalidate, extras = null, expectedResults, expectedFinalUrl }) => {
|
|
70
|
+
const configuration = {
|
|
71
|
+
client_id: 'interactive.public.short',
|
|
72
|
+
redirect_uri: 'http://localhost:4200/authentication/callback',
|
|
73
|
+
scope: 'openid profile email api offline_access',
|
|
74
|
+
authority: 'http://api',
|
|
75
|
+
refresh_time_before_tokens_expiration_in_second: 70,
|
|
76
|
+
logout_tokens_to_invalidate,
|
|
77
|
+
};
|
|
78
|
+
|
|
79
|
+
const fetch = (url, data) => {
|
|
80
|
+
if (url === 'http://api/connect/revocation') {
|
|
81
|
+
return Promise.resolve({ status: 200 });
|
|
82
|
+
}
|
|
83
|
+
return Promise.resolve({
|
|
84
|
+
status: 200,
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
const mockFetchFn = vi.fn().mockImplementation(fetch);
|
|
89
|
+
|
|
90
|
+
const oidc = {
|
|
91
|
+
configuration,
|
|
92
|
+
tokens: { idToken: 'abcd', accessToken: 'abcd', refreshToken: 'abdc' },
|
|
93
|
+
initAsync: () =>
|
|
94
|
+
Promise.resolve({
|
|
95
|
+
revocationEndpoint: 'http://api/connect/revocation',
|
|
96
|
+
endSessionEndpoint: 'http://api/connect/endsession',
|
|
97
|
+
}),
|
|
98
|
+
destroyAsync: () => Promise.resolve(),
|
|
99
|
+
logoutSameTabAsync: () => Promise.resolve(),
|
|
100
|
+
};
|
|
101
|
+
|
|
102
|
+
const oidcDatabase = { default: () => oidc };
|
|
103
|
+
|
|
104
|
+
let finalUrl = '';
|
|
105
|
+
class OidcLocationMock implements ILOidcLocation {
|
|
106
|
+
open(url: string): void {
|
|
107
|
+
finalUrl = url;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
getCurrentHref(): string {
|
|
111
|
+
return '';
|
|
75
112
|
}
|
|
76
113
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
114
|
+
getPath(): string {
|
|
115
|
+
return '';
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
reload(): void {}
|
|
119
|
+
|
|
120
|
+
getOrigin(): string {
|
|
121
|
+
return 'http://localhost:4200';
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
await logoutAsync(
|
|
126
|
+
oidc,
|
|
127
|
+
oidcDatabase,
|
|
128
|
+
mockFetchFn,
|
|
129
|
+
console,
|
|
130
|
+
new OidcLocationMock(),
|
|
131
|
+
)('/logged_out', extras);
|
|
132
|
+
|
|
133
|
+
// @ts-ignore
|
|
134
|
+
|
|
135
|
+
const results = mockFetchFn.mock.calls.map((call, index) => call[1].body);
|
|
80
136
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
});
|
|
137
|
+
expect(results).toEqual(expectedResults);
|
|
138
|
+
expect(finalUrl).toBe(expectedFinalUrl);
|
|
139
|
+
},
|
|
140
|
+
);
|
|
86
141
|
});
|
package/src/logout.ts
CHANGED
|
@@ -1,153 +1,168 @@
|
|
|
1
|
+
import { eventNames } from './events';
|
|
1
2
|
import { initSession } from './initSession.js';
|
|
2
3
|
import { initWorkerAsync } from './initWorker.js';
|
|
4
|
+
import { ILOidcLocation } from './location';
|
|
3
5
|
import { performRevocationRequestAsync, TOKEN_TYPE } from './requests.js';
|
|
4
6
|
import timer from './timer.js';
|
|
5
7
|
import { StringMap } from './types.js';
|
|
6
|
-
import {ILOidcLocation} from "./location";
|
|
7
|
-
import {eventNames} from "./events";
|
|
8
8
|
|
|
9
9
|
export const oidcLogoutTokens = {
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
access_token: 'access_token',
|
|
11
|
+
refresh_token: 'refresh_token',
|
|
12
12
|
};
|
|
13
13
|
|
|
14
|
-
const extractExtras = (extras: StringMap, postKey: string):StringMap => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}
|
|
23
|
-
return postExtras;
|
|
14
|
+
const extractExtras = (extras: StringMap, postKey: string): StringMap => {
|
|
15
|
+
const postExtras: StringMap = {};
|
|
16
|
+
if (extras) {
|
|
17
|
+
for (const [key, value] of Object.entries(extras)) {
|
|
18
|
+
if (key.endsWith(postKey)) {
|
|
19
|
+
const newKey = key.replace(postKey, '');
|
|
20
|
+
postExtras[newKey] = value;
|
|
21
|
+
}
|
|
24
22
|
}
|
|
25
23
|
return postExtras;
|
|
26
|
-
}
|
|
24
|
+
}
|
|
25
|
+
return postExtras;
|
|
26
|
+
};
|
|
27
27
|
|
|
28
|
-
const keepExtras = (extras: StringMap):StringMap => {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
return postExtras;
|
|
28
|
+
const keepExtras = (extras: StringMap): StringMap => {
|
|
29
|
+
const postExtras: StringMap = {};
|
|
30
|
+
if (extras) {
|
|
31
|
+
for (const [key, value] of Object.entries(extras)) {
|
|
32
|
+
if (!key.includes(':')) {
|
|
33
|
+
postExtras[key] = value;
|
|
34
|
+
}
|
|
37
35
|
}
|
|
38
36
|
return postExtras;
|
|
39
|
-
}
|
|
37
|
+
}
|
|
38
|
+
return postExtras;
|
|
39
|
+
};
|
|
40
40
|
|
|
41
|
-
export const destroyAsync =
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
export const destroyAsync = oidc => async status => {
|
|
42
|
+
timer.clearTimeout(oidc.timeoutId);
|
|
43
|
+
oidc.timeoutId = null;
|
|
44
|
+
if (oidc.checkSessionIFrame) {
|
|
45
|
+
oidc.checkSessionIFrame.stop();
|
|
46
|
+
}
|
|
47
|
+
const serviceWorker = await initWorkerAsync(oidc.configuration, oidc.configurationName);
|
|
48
|
+
if (!serviceWorker) {
|
|
49
|
+
const session = initSession(oidc.configurationName, oidc.configuration.storage);
|
|
50
|
+
await session.clearAsync(status);
|
|
51
|
+
} else {
|
|
52
|
+
await serviceWorker.clearAsync(status);
|
|
53
|
+
}
|
|
54
|
+
oidc.tokens = null;
|
|
55
|
+
oidc.userInfo = null;
|
|
56
56
|
};
|
|
57
57
|
|
|
58
|
-
export const logoutAsync =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
console, oicLocation:ILOidcLocation) => async (callbackPathOrUrl: string | null | undefined = undefined, extras: StringMap = null) => {
|
|
58
|
+
export const logoutAsync =
|
|
59
|
+
(oidc, oidcDatabase, fetch, console, oicLocation: ILOidcLocation) =>
|
|
60
|
+
async (callbackPathOrUrl: string | null | undefined = undefined, extras: StringMap = null) => {
|
|
62
61
|
const configuration = oidc.configuration;
|
|
63
|
-
const oidcServerConfiguration = await oidc.initAsync(
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
62
|
+
const oidcServerConfiguration = await oidc.initAsync(
|
|
63
|
+
configuration.authority,
|
|
64
|
+
configuration.authority_configuration,
|
|
65
|
+
);
|
|
66
|
+
if (callbackPathOrUrl && typeof callbackPathOrUrl !== 'string') {
|
|
67
|
+
callbackPathOrUrl = undefined;
|
|
68
|
+
console.warn('callbackPathOrUrl path is not a string');
|
|
67
69
|
}
|
|
68
|
-
const path =
|
|
70
|
+
const path =
|
|
71
|
+
callbackPathOrUrl === null || callbackPathOrUrl === undefined
|
|
72
|
+
? oicLocation.getPath()
|
|
73
|
+
: callbackPathOrUrl;
|
|
69
74
|
let isUri = false;
|
|
70
75
|
if (callbackPathOrUrl) {
|
|
71
|
-
|
|
76
|
+
isUri = callbackPathOrUrl.includes('https://') || callbackPathOrUrl.includes('http://');
|
|
72
77
|
}
|
|
73
|
-
const url = isUri ? callbackPathOrUrl : oicLocation.getOrigin() + path
|
|
78
|
+
const url = isUri ? callbackPathOrUrl : oicLocation.getOrigin() + path;
|
|
74
79
|
// @ts-ignore
|
|
75
80
|
const idToken = oidc.tokens ? oidc.tokens.idToken : '';
|
|
76
81
|
try {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
82
|
+
const revocationEndpoint = oidcServerConfiguration.revocationEndpoint;
|
|
83
|
+
if (revocationEndpoint) {
|
|
84
|
+
const promises = [];
|
|
85
|
+
const accessToken = oidc.tokens ? oidc.tokens.accessToken : null;
|
|
86
|
+
if (
|
|
87
|
+
accessToken &&
|
|
88
|
+
configuration.logout_tokens_to_invalidate.includes(oidcLogoutTokens.access_token)
|
|
89
|
+
) {
|
|
90
|
+
const revokeAccessTokenExtras = extractExtras(extras, ':revoke_access_token');
|
|
91
|
+
const revokeAccessTokenPromise = performRevocationRequestAsync(fetch)(
|
|
92
|
+
revocationEndpoint,
|
|
93
|
+
accessToken,
|
|
94
|
+
TOKEN_TYPE.access_token,
|
|
95
|
+
configuration.client_id,
|
|
96
|
+
revokeAccessTokenExtras,
|
|
97
|
+
);
|
|
98
|
+
promises.push(revokeAccessTokenPromise);
|
|
99
|
+
}
|
|
100
|
+
const refreshToken = oidc.tokens ? oidc.tokens.refreshToken : null;
|
|
101
|
+
if (
|
|
102
|
+
refreshToken &&
|
|
103
|
+
configuration.logout_tokens_to_invalidate.includes(oidcLogoutTokens.refresh_token)
|
|
104
|
+
) {
|
|
105
|
+
const revokeAccessTokenExtras = extractExtras(extras, ':revoke_refresh_token');
|
|
106
|
+
const revokeRefreshTokenPromise = performRevocationRequestAsync(fetch)(
|
|
107
|
+
revocationEndpoint,
|
|
108
|
+
refreshToken,
|
|
109
|
+
TOKEN_TYPE.refresh_token,
|
|
110
|
+
configuration.client_id,
|
|
111
|
+
revokeAccessTokenExtras,
|
|
112
|
+
);
|
|
113
|
+
promises.push(revokeRefreshTokenPromise);
|
|
114
|
+
}
|
|
115
|
+
if (promises.length > 0) {
|
|
116
|
+
await Promise.all(promises);
|
|
103
117
|
}
|
|
118
|
+
}
|
|
104
119
|
} catch (exception) {
|
|
105
|
-
|
|
106
|
-
|
|
120
|
+
console.warn(
|
|
121
|
+
'logoutAsync: error when revoking tokens, if the error persist, you ay configure property logout_tokens_to_invalidate from configuration to avoid this error',
|
|
122
|
+
);
|
|
123
|
+
console.warn(exception);
|
|
107
124
|
}
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
125
|
+
const sub = oidc.tokens?.idTokenPayload?.sub ?? null;
|
|
126
|
+
|
|
112
127
|
await oidc.destroyAsync('LOGGED_OUT');
|
|
113
|
-
for (const [
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
128
|
+
for (const [, itemOidc] of Object.entries(oidcDatabase)) {
|
|
129
|
+
if (itemOidc !== oidc) {
|
|
130
|
+
// @ts-ignore
|
|
131
|
+
await oidc.logoutSameTabAsync(oidc.configuration.client_id, sub);
|
|
132
|
+
} else {
|
|
133
|
+
oidc.publishEvent(eventNames.logout_from_same_tab, {});
|
|
134
|
+
}
|
|
120
135
|
}
|
|
121
|
-
|
|
136
|
+
|
|
122
137
|
const oidcExtras = extractExtras(extras, ':oidc');
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
if(noReload) {
|
|
126
|
-
|
|
138
|
+
const noReload = oidcExtras && oidcExtras['no_reload'] === 'true';
|
|
139
|
+
|
|
140
|
+
if (noReload) {
|
|
141
|
+
return;
|
|
127
142
|
}
|
|
128
143
|
|
|
129
144
|
const endPointExtras = keepExtras(extras);
|
|
130
|
-
|
|
145
|
+
|
|
131
146
|
if (oidcServerConfiguration.endSessionEndpoint) {
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
147
|
+
if (!('id_token_hint' in endPointExtras)) {
|
|
148
|
+
endPointExtras['id_token_hint'] = idToken;
|
|
149
|
+
}
|
|
150
|
+
if (!('post_logout_redirect_uri' in endPointExtras) && callbackPathOrUrl !== null) {
|
|
151
|
+
endPointExtras['post_logout_redirect_uri'] = url;
|
|
152
|
+
}
|
|
153
|
+
let queryString = '';
|
|
154
|
+
for (const [key, value] of Object.entries(endPointExtras)) {
|
|
155
|
+
if (value !== null && value !== undefined) {
|
|
156
|
+
if (queryString === '') {
|
|
157
|
+
queryString += '?';
|
|
158
|
+
} else {
|
|
159
|
+
queryString += '&';
|
|
160
|
+
}
|
|
161
|
+
queryString += `${key}=${encodeURIComponent(value)}`;
|
|
137
162
|
}
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
if(value !== null && value !== undefined) {
|
|
141
|
-
if (queryString === '') {
|
|
142
|
-
queryString += '?';
|
|
143
|
-
} else {
|
|
144
|
-
queryString += '&';
|
|
145
|
-
}
|
|
146
|
-
queryString += `${key}=${encodeURIComponent(value)}`;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
oicLocation.open(`${oidcServerConfiguration.endSessionEndpoint}${queryString}`);
|
|
163
|
+
}
|
|
164
|
+
oicLocation.open(`${oidcServerConfiguration.endSessionEndpoint}${queryString}`);
|
|
150
165
|
} else {
|
|
151
|
-
|
|
166
|
+
oicLocation.reload();
|
|
152
167
|
}
|
|
153
|
-
};
|
|
168
|
+
};
|