oidc-spa 7.2.2 → 7.2.3
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/core/createOidc.js +1 -1
- package/esm/core/AuthResponse.js +2 -2
- package/esm/core/Oidc.d.ts +1 -1
- package/esm/core/OidcMetadata.js +2 -2
- package/esm/core/StateData.js +3 -3
- package/esm/core/createOidc.d.ts +2 -2
- package/esm/core/createOidc.js +33 -33
- package/esm/core/diagnostic.d.ts +1 -1
- package/esm/core/diagnostic.js +4 -4
- package/esm/core/evtIsUserActive.d.ts +1 -1
- package/esm/core/evtIsUserActive.js +5 -5
- package/esm/core/handleOidcCallback.d.ts +2 -2
- package/esm/core/handleOidcCallback.js +5 -5
- package/esm/core/iframeMessageProtection.d.ts +1 -1
- package/esm/core/iframeMessageProtection.js +3 -3
- package/esm/core/index.d.ts +4 -4
- package/esm/core/index.js +4 -4
- package/esm/core/isNewBrowserSession.d.ts +1 -1
- package/esm/core/loginOrGoToAuthServer.d.ts +2 -2
- package/esm/core/loginOrGoToAuthServer.js +6 -6
- package/esm/core/loginPropagationToOtherTabs.js +3 -3
- package/esm/core/loginSilent.d.ts +2 -2
- package/esm/core/loginSilent.js +8 -8
- package/esm/core/logoutPropagationToOtherTabs.js +3 -3
- package/esm/core/oidcClientTsUserToTokens.d.ts +2 -2
- package/esm/core/oidcClientTsUserToTokens.js +4 -4
- package/esm/core/ongoingLoginOrRefreshProcesses.js +3 -3
- package/esm/core/persistedAuthState.js +2 -2
- package/esm/entrypoint.js +3 -3
- package/esm/index.d.ts +1 -1
- package/esm/index.js +2 -2
- package/esm/keycloak/index.d.ts +3 -3
- package/esm/keycloak/index.js +3 -3
- package/esm/keycloak/keycloak-js/Keycloak.d.ts +1 -1
- package/esm/keycloak/keycloak-js/Keycloak.js +9 -9
- package/esm/keycloak/keycloak-js/index.d.ts +2 -2
- package/esm/keycloak/keycloak-js/index.js +2 -2
- package/esm/keycloak/keycloakIssuerUriParsed.js +3 -3
- package/esm/keycloak/keycloakUtils.d.ts +1 -1
- package/esm/keycloak/keycloakUtils.js +3 -3
- package/esm/keycloak-js.d.ts +1 -1
- package/esm/keycloak-js.js +2 -2
- package/esm/mock/index.d.ts +1 -1
- package/esm/mock/index.js +2 -2
- package/esm/mock/oidc.d.ts +1 -1
- package/esm/mock/oidc.js +6 -6
- package/esm/mock/react.d.ts +8 -8
- package/esm/mock/react.js +3 -3
- package/esm/react/index.d.ts +1 -1
- package/esm/react/index.js +2 -2
- package/esm/react/react.d.ts +2 -2
- package/esm/react/react.js +6 -6
- package/esm/tools/EphemeralSessionStorage.js +2 -2
- package/esm/tools/Evt.js +3 -3
- package/esm/tools/getDownlinkAndRtt.js +2 -2
- package/esm/tools/getIsOnline.js +2 -2
- package/esm/tools/getPrUserInteraction.js +2 -2
- package/esm/tools/parseKeycloakIssuerUri.js +2 -2
- package/esm/tools/readExpirationTimeInJwt.js +3 -3
- package/esm/tools/startCountdown.js +2 -2
- package/esm/tools/subscribeToUserInteraction.js +2 -2
- package/esm/tools/workerTimers.js +2 -2
- package/package.json +11 -33
package/core/createOidc.js
CHANGED
|
@@ -63,7 +63,7 @@ const isNewBrowserSession_1 = require("./isNewBrowserSession");
|
|
|
63
63
|
const getIsOnline_1 = require("../tools/getIsOnline");
|
|
64
64
|
const isKeycloak_1 = require("../keycloak/isKeycloak");
|
|
65
65
|
// NOTE: Replaced at build time
|
|
66
|
-
const VERSION = "7.2.
|
|
66
|
+
const VERSION = "7.2.3";
|
|
67
67
|
const globalContext = {
|
|
68
68
|
prOidcByConfigId: new Map(),
|
|
69
69
|
hasLogoutBeenCalled: (0, tsafe_1.id)(false),
|
package/esm/core/AuthResponse.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addOrUpdateSearchParam } from "../tools/urlSearchParams
|
|
1
|
+
import { addOrUpdateSearchParam } from "../tools/urlSearchParams";
|
|
2
2
|
export function authResponseToUrl(authResponse) {
|
|
3
3
|
let authResponseUrl = "https://dummy.com";
|
|
4
4
|
for (const [name, value] of Object.entries(authResponse)) {
|
|
@@ -15,4 +15,4 @@ export function authResponseToUrl(authResponse) {
|
|
|
15
15
|
authResponseUrl = `${authResponseUrl}#${authResponseUrl.split("?")[1]}`;
|
|
16
16
|
return authResponseUrl;
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=AuthResponse.js.map
|
|
18
|
+
//# sourceMappingURL=AuthResponse.js.map
|
package/esm/core/Oidc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { OidcInitializationError } from "./OidcInitializationError
|
|
1
|
+
import type { OidcInitializationError } from "./OidcInitializationError";
|
|
2
2
|
export declare type Oidc<DecodedIdToken extends Record<string, unknown> = Oidc.Tokens.DecodedIdToken_base> = Oidc.LoggedIn<DecodedIdToken> | Oidc.NotLoggedIn;
|
|
3
3
|
export declare namespace Oidc {
|
|
4
4
|
type Common = {
|
package/esm/core/OidcMetadata.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { assert } from "../vendor/frontend/tsafe
|
|
1
|
+
import { assert } from "../vendor/frontend/tsafe";
|
|
2
2
|
assert;
|
|
3
|
-
//# sourceMappingURL=OidcMetadata.js.map
|
|
3
|
+
//# sourceMappingURL=OidcMetadata.js.map
|
package/esm/core/StateData.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { typeGuard, assert } from "../vendor/frontend/tsafe
|
|
2
|
-
import { generateUrlSafeRandom } from "../tools/generateUrlSafeRandom
|
|
1
|
+
import { typeGuard, assert } from "../vendor/frontend/tsafe";
|
|
2
|
+
import { generateUrlSafeRandom } from "../tools/generateUrlSafeRandom";
|
|
3
3
|
const STATE_QUERY_PARAM_VALUE_IDENTIFIER_PREFIX = "b2lkYy1zcGEu";
|
|
4
4
|
const RANDOM_STRING_LENGTH = 32 - STATE_QUERY_PARAM_VALUE_IDENTIFIER_PREFIX.length;
|
|
5
5
|
export function generateStateUrlParamValue() {
|
|
@@ -52,4 +52,4 @@ export function markStateDataAsProcessedByCallback(params) {
|
|
|
52
52
|
obj.data.hasBeenProcessedByCallback = true;
|
|
53
53
|
setStateStore({ stateUrlParamValue, obj });
|
|
54
54
|
}
|
|
55
|
-
//# sourceMappingURL=StateData.js.map
|
|
55
|
+
//# sourceMappingURL=StateData.js.map
|
package/esm/core/createOidc.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { OidcMetadata } from "./OidcMetadata
|
|
2
|
-
import type { Oidc } from "./Oidc
|
|
1
|
+
import type { OidcMetadata } from "./OidcMetadata";
|
|
2
|
+
import type { Oidc } from "./Oidc";
|
|
3
3
|
export type ParamsOfCreateOidc<DecodedIdToken extends Record<string, unknown> = Record<string, unknown>, AutoLogin extends boolean = false> = {
|
|
4
4
|
issuerUri: string;
|
|
5
5
|
clientId: string;
|
package/esm/core/createOidc.js
CHANGED
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
import { UserManager as OidcClientTsUserManager, WebStorageStateStore, InMemoryWebStorage } from "../vendor/frontend/oidc-client-ts
|
|
2
|
-
import { id, assert, is } from "../vendor/frontend/tsafe
|
|
3
|
-
import { setTimeout, clearTimeout } from "../tools/workerTimers
|
|
4
|
-
import { Deferred } from "../tools/Deferred
|
|
5
|
-
import { createEvtIsUserActive } from "./evtIsUserActive
|
|
6
|
-
import { createStartCountdown } from "../tools/startCountdown
|
|
7
|
-
import { toHumanReadableDuration } from "../tools/toHumanReadableDuration
|
|
8
|
-
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl
|
|
9
|
-
import { OidcInitializationError } from "./OidcInitializationError
|
|
10
|
-
import { generateStateUrlParamValue, STATE_STORE_KEY_PREFIX } from "./StateData
|
|
11
|
-
import { notifyOtherTabsOfLogout, getPrOtherTabLogout } from "./logoutPropagationToOtherTabs
|
|
12
|
-
import { notifyOtherTabsOfLogin, getPrOtherTabLogin } from "./loginPropagationToOtherTabs
|
|
13
|
-
import { getConfigId } from "./configId
|
|
14
|
-
import { oidcClientTsUserToTokens } from "./oidcClientTsUserToTokens
|
|
15
|
-
import { loginSilent } from "./loginSilent
|
|
16
|
-
import { authResponseToUrl } from "./AuthResponse
|
|
17
|
-
import { handleOidcCallback, retrieveRedirectAuthResponseAndStateData } from "./handleOidcCallback
|
|
18
|
-
import { getPersistedAuthState, persistAuthState } from "./persistedAuthState
|
|
19
|
-
import { createEvt } from "../tools/Evt
|
|
20
|
-
import { getHaveSharedParentDomain } from "../tools/haveSharedParentDomain
|
|
21
|
-
import { createLoginOrGoToAuthServer, getPrSafelyRestoredFromBfCacheAfterLoginBackNavigation } from "./loginOrGoToAuthServer
|
|
22
|
-
import { createEphemeralSessionStorage } from "../tools/EphemeralSessionStorage
|
|
23
|
-
import { startLoginOrRefreshProcess, waitForAllOtherOngoingLoginOrRefreshProcessesToComplete } from "./ongoingLoginOrRefreshProcesses
|
|
24
|
-
import { initialLocationHref } from "./initialLocationHref
|
|
25
|
-
import { createGetIsNewBrowserSession } from "./isNewBrowserSession
|
|
26
|
-
import { getIsOnline } from "../tools/getIsOnline
|
|
27
|
-
import { isKeycloak } from "../keycloak/isKeycloak
|
|
1
|
+
import { UserManager as OidcClientTsUserManager, WebStorageStateStore, InMemoryWebStorage } from "../vendor/frontend/oidc-client-ts";
|
|
2
|
+
import { id, assert, is } from "../vendor/frontend/tsafe";
|
|
3
|
+
import { setTimeout, clearTimeout } from "../tools/workerTimers";
|
|
4
|
+
import { Deferred } from "../tools/Deferred";
|
|
5
|
+
import { createEvtIsUserActive } from "./evtIsUserActive";
|
|
6
|
+
import { createStartCountdown } from "../tools/startCountdown";
|
|
7
|
+
import { toHumanReadableDuration } from "../tools/toHumanReadableDuration";
|
|
8
|
+
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl";
|
|
9
|
+
import { OidcInitializationError } from "./OidcInitializationError";
|
|
10
|
+
import { generateStateUrlParamValue, STATE_STORE_KEY_PREFIX } from "./StateData";
|
|
11
|
+
import { notifyOtherTabsOfLogout, getPrOtherTabLogout } from "./logoutPropagationToOtherTabs";
|
|
12
|
+
import { notifyOtherTabsOfLogin, getPrOtherTabLogin } from "./loginPropagationToOtherTabs";
|
|
13
|
+
import { getConfigId } from "./configId";
|
|
14
|
+
import { oidcClientTsUserToTokens } from "./oidcClientTsUserToTokens";
|
|
15
|
+
import { loginSilent } from "./loginSilent";
|
|
16
|
+
import { authResponseToUrl } from "./AuthResponse";
|
|
17
|
+
import { handleOidcCallback, retrieveRedirectAuthResponseAndStateData } from "./handleOidcCallback";
|
|
18
|
+
import { getPersistedAuthState, persistAuthState } from "./persistedAuthState";
|
|
19
|
+
import { createEvt } from "../tools/Evt";
|
|
20
|
+
import { getHaveSharedParentDomain } from "../tools/haveSharedParentDomain";
|
|
21
|
+
import { createLoginOrGoToAuthServer, getPrSafelyRestoredFromBfCacheAfterLoginBackNavigation } from "./loginOrGoToAuthServer";
|
|
22
|
+
import { createEphemeralSessionStorage } from "../tools/EphemeralSessionStorage";
|
|
23
|
+
import { startLoginOrRefreshProcess, waitForAllOtherOngoingLoginOrRefreshProcessesToComplete } from "./ongoingLoginOrRefreshProcesses";
|
|
24
|
+
import { initialLocationHref } from "./initialLocationHref";
|
|
25
|
+
import { createGetIsNewBrowserSession } from "./isNewBrowserSession";
|
|
26
|
+
import { getIsOnline } from "../tools/getIsOnline";
|
|
27
|
+
import { isKeycloak } from "../keycloak/isKeycloak";
|
|
28
28
|
// NOTE: Replaced at build time
|
|
29
|
-
const VERSION = "7.2.
|
|
29
|
+
const VERSION = "7.2.3";
|
|
30
30
|
const globalContext = {
|
|
31
31
|
prOidcByConfigId: new Map(),
|
|
32
32
|
hasLogoutBeenCalled: id(false),
|
|
@@ -237,7 +237,7 @@ export async function createOidc_nonMemoized(params, preProcessedParams) {
|
|
|
237
237
|
catch (error) {
|
|
238
238
|
assert(error instanceof Error, "741947");
|
|
239
239
|
if (error.message === "Failed to fetch") {
|
|
240
|
-
return (await import("./diagnostic
|
|
240
|
+
return (await import("./diagnostic")).createFailedToFetchTokenEndpointInitializationError({
|
|
241
241
|
clientId,
|
|
242
242
|
issuerUri
|
|
243
243
|
});
|
|
@@ -370,11 +370,11 @@ export async function createOidc_nonMemoized(params, preProcessedParams) {
|
|
|
370
370
|
if (result_loginSilent.outcome === "failure") {
|
|
371
371
|
switch (result_loginSilent.cause) {
|
|
372
372
|
case "can't reach well-known oidc endpoint":
|
|
373
|
-
return (await import("./diagnostic
|
|
373
|
+
return (await import("./diagnostic")).createWellKnownOidcConfigurationEndpointUnreachableInitializationError({
|
|
374
374
|
issuerUri
|
|
375
375
|
});
|
|
376
376
|
case "timeout":
|
|
377
|
-
return (await import("./diagnostic
|
|
377
|
+
return (await import("./diagnostic")).createIframeTimeoutInitializationError({
|
|
378
378
|
redirectUri: homeUrlAndRedirectUri,
|
|
379
379
|
clientId,
|
|
380
380
|
issuerUri,
|
|
@@ -393,7 +393,7 @@ export async function createOidc_nonMemoized(params, preProcessedParams) {
|
|
|
393
393
|
catch (error) {
|
|
394
394
|
assert(error instanceof Error, "433344");
|
|
395
395
|
if (error.message === "Failed to fetch") {
|
|
396
|
-
return (await import("./diagnostic
|
|
396
|
+
return (await import("./diagnostic")).createFailedToFetchTokenEndpointInitializationError({
|
|
397
397
|
clientId,
|
|
398
398
|
issuerUri
|
|
399
399
|
});
|
|
@@ -1035,4 +1035,4 @@ export async function createOidc_nonMemoized(params, preProcessedParams) {
|
|
|
1035
1035
|
}
|
|
1036
1036
|
return oidc_loggedIn;
|
|
1037
1037
|
}
|
|
1038
|
-
//# sourceMappingURL=createOidc.js.map
|
|
1038
|
+
//# sourceMappingURL=createOidc.js.map
|
package/esm/core/diagnostic.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { OidcInitializationError } from "./OidcInitializationError
|
|
1
|
+
import { OidcInitializationError } from "./OidcInitializationError";
|
|
2
2
|
export declare function createWellKnownOidcConfigurationEndpointUnreachableInitializationError(params: {
|
|
3
3
|
issuerUri: string;
|
|
4
4
|
}): Promise<OidcInitializationError>;
|
package/esm/core/diagnostic.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { OidcInitializationError } from "./OidcInitializationError
|
|
2
|
-
import { isKeycloak, createKeycloakUtils } from "../keycloak
|
|
3
|
-
import { getIsValidRemoteJson } from "../tools/getIsValidRemoteJson
|
|
1
|
+
import { OidcInitializationError } from "./OidcInitializationError";
|
|
2
|
+
import { isKeycloak, createKeycloakUtils } from "../keycloak";
|
|
3
|
+
import { getIsValidRemoteJson } from "../tools/getIsValidRemoteJson";
|
|
4
4
|
export async function createWellKnownOidcConfigurationEndpointUnreachableInitializationError(params) {
|
|
5
5
|
const { issuerUri } = params;
|
|
6
6
|
const WELL_KNOWN_PATH = "/.well-known/openid-configuration";
|
|
@@ -206,4 +206,4 @@ export async function createFailedToFetchTokenEndpointInitializationError(params
|
|
|
206
206
|
].join(" ")
|
|
207
207
|
});
|
|
208
208
|
}
|
|
209
|
-
//# sourceMappingURL=diagnostic.js.map
|
|
209
|
+
//# sourceMappingURL=diagnostic.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createEvt } from "../tools/Evt
|
|
2
|
-
import { subscribeToUserInteraction } from "../tools/subscribeToUserInteraction
|
|
3
|
-
import { assert, is, id } from "../vendor/frontend/tsafe
|
|
4
|
-
import { setTimeout, clearTimeout } from "../tools/workerTimers
|
|
1
|
+
import { createEvt } from "../tools/Evt";
|
|
2
|
+
import { subscribeToUserInteraction } from "../tools/subscribeToUserInteraction";
|
|
3
|
+
import { assert, is, id } from "../vendor/frontend/tsafe";
|
|
4
|
+
import { setTimeout, clearTimeout } from "../tools/workerTimers";
|
|
5
5
|
const globalContext = {
|
|
6
6
|
appInstanceId: Math.random().toString(36).slice(2),
|
|
7
7
|
evtIsUserActiveBySessionId: new Map()
|
|
@@ -73,4 +73,4 @@ export function createEvtIsUserActive(params) {
|
|
|
73
73
|
}
|
|
74
74
|
return evtIsUserActive;
|
|
75
75
|
}
|
|
76
|
-
//# sourceMappingURL=evtIsUserActive.js.map
|
|
76
|
+
//# sourceMappingURL=evtIsUserActive.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type StateData } from "./StateData
|
|
2
|
-
import type { AuthResponse } from "./AuthResponse
|
|
1
|
+
import { type StateData } from "./StateData";
|
|
2
|
+
import type { AuthResponse } from "./AuthResponse";
|
|
3
3
|
export declare function handleOidcCallback(): {
|
|
4
4
|
isHandled: boolean;
|
|
5
5
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { getStateData, markStateDataAsProcessedByCallback, getIsStatQueryParamValue } from "./StateData
|
|
2
|
-
import { assert, id } from "../vendor/frontend/tsafe
|
|
3
|
-
import { initialLocationHref } from "./initialLocationHref
|
|
4
|
-
import { encryptAuthResponse } from "./iframeMessageProtection
|
|
1
|
+
import { getStateData, markStateDataAsProcessedByCallback, getIsStatQueryParamValue } from "./StateData";
|
|
2
|
+
import { assert, id } from "../vendor/frontend/tsafe";
|
|
3
|
+
import { initialLocationHref } from "./initialLocationHref";
|
|
4
|
+
import { encryptAuthResponse } from "./iframeMessageProtection";
|
|
5
5
|
const globalContext = {
|
|
6
6
|
previousCall: id(undefined)
|
|
7
7
|
};
|
|
@@ -222,4 +222,4 @@ const { writeBackForwardTracker, readBackForwardTracker, clearBackForwardTracker
|
|
|
222
222
|
}
|
|
223
223
|
return { writeBackForwardTracker, readBackForwardTracker, clearBackForwardTracker };
|
|
224
224
|
})();
|
|
225
|
-
//# sourceMappingURL=handleOidcCallback.js.map
|
|
225
|
+
//# sourceMappingURL=handleOidcCallback.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type AuthResponse } from "./AuthResponse
|
|
1
|
+
import { type AuthResponse } from "./AuthResponse";
|
|
2
2
|
export declare function preventSessionStorageSetItemOfPublicKeyByThirdParty(): void;
|
|
3
3
|
export declare function initIframeMessageProtection(params: {
|
|
4
4
|
stateUrlParamValue: string;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assert } from "../vendor/frontend/tsafe
|
|
2
|
-
import { asymmetricEncrypt, asymmetricDecrypt, generateKeys } from "../tools/asymmetricEncryption
|
|
1
|
+
import { assert } from "../vendor/frontend/tsafe";
|
|
2
|
+
import { asymmetricEncrypt, asymmetricDecrypt, generateKeys } from "../tools/asymmetricEncryption";
|
|
3
3
|
const sessionStorage_original = window.sessionStorage;
|
|
4
4
|
const setItem_real = Storage.prototype.setItem;
|
|
5
5
|
const SESSION_STORAGE_PREFIX = "oidc-spa_iframe_authResponse_publicKey_";
|
|
@@ -62,4 +62,4 @@ export async function encryptAuthResponse(params) {
|
|
|
62
62
|
const encryptedMessage = `${ENCRYPTED_AUTH_RESPONSES_PREFIX}${encryptedMessage_withoutPrefix}`;
|
|
63
63
|
return { encryptedMessage };
|
|
64
64
|
}
|
|
65
|
-
//# sourceMappingURL=iframeMessageProtection.js.map
|
|
65
|
+
//# sourceMappingURL=iframeMessageProtection.js.map
|
package/esm/core/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export type { Oidc } from "./Oidc
|
|
2
|
-
export { createOidc, type ParamsOfCreateOidc } from "./createOidc
|
|
3
|
-
export { OidcInitializationError } from "./OidcInitializationError
|
|
4
|
-
export { handleOidcCallback } from "./handleOidcCallback
|
|
1
|
+
export type { Oidc } from "./Oidc";
|
|
2
|
+
export { createOidc, type ParamsOfCreateOidc } from "./createOidc";
|
|
3
|
+
export { OidcInitializationError } from "./OidcInitializationError";
|
|
4
|
+
export { handleOidcCallback } from "./handleOidcCallback";
|
package/esm/core/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { createOidc } from "./createOidc
|
|
2
|
-
export { OidcInitializationError } from "./OidcInitializationError
|
|
3
|
-
export { handleOidcCallback } from "./handleOidcCallback
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { createOidc } from "./createOidc";
|
|
2
|
+
export { OidcInitializationError } from "./OidcInitializationError";
|
|
3
|
+
export { handleOidcCallback } from "./handleOidcCallback";
|
|
4
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UserManager as OidcClientTsUserManager } from "../vendor/frontend/oidc-client-ts
|
|
2
|
-
import type { NonPostableEvt } from "../tools/Evt
|
|
1
|
+
import type { UserManager as OidcClientTsUserManager } from "../vendor/frontend/oidc-client-ts";
|
|
2
|
+
import type { NonPostableEvt } from "../tools/Evt";
|
|
3
3
|
type Params = Params.Login | Params.GoToAuthServer;
|
|
4
4
|
declare namespace Params {
|
|
5
5
|
type Common = {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl
|
|
2
|
-
import { assert, noUndefined } from "../vendor/frontend/tsafe
|
|
3
|
-
import { createStatefulEvt } from "../tools/StatefulEvt
|
|
4
|
-
import { Deferred } from "../tools/Deferred
|
|
5
|
-
import { addOrUpdateSearchParam, getAllSearchParams } from "../tools/urlSearchParams
|
|
1
|
+
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl";
|
|
2
|
+
import { assert, noUndefined } from "../vendor/frontend/tsafe";
|
|
3
|
+
import { createStatefulEvt } from "../tools/StatefulEvt";
|
|
4
|
+
import { Deferred } from "../tools/Deferred";
|
|
5
|
+
import { addOrUpdateSearchParam, getAllSearchParams } from "../tools/urlSearchParams";
|
|
6
6
|
const globalContext = {
|
|
7
7
|
evtHasLoginBeenCalled: createStatefulEvt(() => false)
|
|
8
8
|
};
|
|
@@ -213,4 +213,4 @@ export function createLoginOrGoToAuthServer(params) {
|
|
|
213
213
|
loginOrGoToAuthServer
|
|
214
214
|
};
|
|
215
215
|
}
|
|
216
|
-
//# sourceMappingURL=loginOrGoToAuthServer.js.map
|
|
216
|
+
//# sourceMappingURL=loginOrGoToAuthServer.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assert, is } from "../vendor/frontend/tsafe
|
|
2
|
-
import { Deferred } from "../tools/Deferred
|
|
1
|
+
import { assert, is } from "../vendor/frontend/tsafe";
|
|
2
|
+
import { Deferred } from "../tools/Deferred";
|
|
3
3
|
const globalContext = {
|
|
4
4
|
appInstanceId: Math.random().toString(36).slice(2)
|
|
5
5
|
};
|
|
@@ -30,4 +30,4 @@ export function getPrOtherTabLogin(params) {
|
|
|
30
30
|
const prOtherTabLogin = dOtherTabLogin.pr;
|
|
31
31
|
return { prOtherTabLogin };
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=loginPropagationToOtherTabs.js.map
|
|
33
|
+
//# sourceMappingURL=loginPropagationToOtherTabs.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { UserManager as OidcClientTsUserManager, User as OidcClientTsUser } from "../vendor/frontend/oidc-client-ts
|
|
2
|
-
import { type AuthResponse } from "./AuthResponse
|
|
1
|
+
import type { UserManager as OidcClientTsUserManager, User as OidcClientTsUser } from "../vendor/frontend/oidc-client-ts";
|
|
2
|
+
import { type AuthResponse } from "./AuthResponse";
|
|
3
3
|
type ResultOfLoginSilent = {
|
|
4
4
|
outcome: "got auth response from iframe";
|
|
5
5
|
authResponse: AuthResponse;
|
package/esm/core/loginSilent.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { Deferred } from "../tools/Deferred
|
|
2
|
-
import { id, assert, noUndefined } from "../vendor/frontend/tsafe
|
|
3
|
-
import { getStateData, clearStateStore } from "./StateData
|
|
4
|
-
import { getDownlinkAndRtt } from "../tools/getDownlinkAndRtt
|
|
5
|
-
import { getIsDev } from "../tools/isDev
|
|
6
|
-
import { addOrUpdateSearchParam } from "../tools/urlSearchParams
|
|
7
|
-
import { initIframeMessageProtection } from "./iframeMessageProtection
|
|
1
|
+
import { Deferred } from "../tools/Deferred";
|
|
2
|
+
import { id, assert, noUndefined } from "../vendor/frontend/tsafe";
|
|
3
|
+
import { getStateData, clearStateStore } from "./StateData";
|
|
4
|
+
import { getDownlinkAndRtt } from "../tools/getDownlinkAndRtt";
|
|
5
|
+
import { getIsDev } from "../tools/isDev";
|
|
6
|
+
import { addOrUpdateSearchParam } from "../tools/urlSearchParams";
|
|
7
|
+
import { initIframeMessageProtection } from "./iframeMessageProtection";
|
|
8
8
|
export async function loginSilent(params) {
|
|
9
9
|
const { oidcClientTsUserManager, stateUrlParamValue_instance, configId, transformUrlBeforeRedirect, getExtraQueryParams, getExtraTokenParams, autoLogin } = params;
|
|
10
10
|
const dResult = new Deferred();
|
|
@@ -147,4 +147,4 @@ export async function loginSilent(params) {
|
|
|
147
147
|
});
|
|
148
148
|
return dResult.pr;
|
|
149
149
|
}
|
|
150
|
-
//# sourceMappingURL=loginSilent.js.map
|
|
150
|
+
//# sourceMappingURL=loginSilent.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assert, is } from "../vendor/frontend/tsafe
|
|
2
|
-
import { Deferred } from "../tools/Deferred
|
|
1
|
+
import { assert, is } from "../vendor/frontend/tsafe";
|
|
2
|
+
import { Deferred } from "../tools/Deferred";
|
|
3
3
|
const globalContext = {
|
|
4
4
|
appInstanceId: Math.random().toString(36).slice(2)
|
|
5
5
|
};
|
|
@@ -30,4 +30,4 @@ export function getPrOtherTabLogout(params) {
|
|
|
30
30
|
const prOtherTabLogout = dOtherTabLogout.pr;
|
|
31
31
|
return { prOtherTabLogout };
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=logoutPropagationToOtherTabs.js.map
|
|
33
|
+
//# sourceMappingURL=logoutPropagationToOtherTabs.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { User as OidcClientTsUser } from "../vendor/frontend/oidc-client-ts
|
|
2
|
-
import type { Oidc } from "./Oidc
|
|
1
|
+
import type { User as OidcClientTsUser } from "../vendor/frontend/oidc-client-ts";
|
|
2
|
+
import type { Oidc } from "./Oidc";
|
|
3
3
|
export declare function oidcClientTsUserToTokens<DecodedIdToken extends Record<string, unknown>>(params: {
|
|
4
4
|
oidcClientTsUser: OidcClientTsUser;
|
|
5
5
|
decodedIdTokenSchema?: {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { assert, id } from "../vendor/frontend/tsafe
|
|
2
|
-
import { readExpirationTimeInJwt } from "../tools/readExpirationTimeInJwt
|
|
3
|
-
import { decodeJwt } from "../tools/decodeJwt
|
|
1
|
+
import { assert, id } from "../vendor/frontend/tsafe";
|
|
2
|
+
import { readExpirationTimeInJwt } from "../tools/readExpirationTimeInJwt";
|
|
3
|
+
import { decodeJwt } from "../tools/decodeJwt";
|
|
4
4
|
export function oidcClientTsUserToTokens(params) {
|
|
5
5
|
const { oidcClientTsUser, decodedIdTokenSchema, __unsafe_useIdTokenAsAccessToken, decodedIdToken_previous, log } = params;
|
|
6
6
|
const isFirstInit = decodedIdToken_previous === undefined;
|
|
@@ -152,4 +152,4 @@ export function oidcClientTsUserToTokens(params) {
|
|
|
152
152
|
}
|
|
153
153
|
return tokens;
|
|
154
154
|
}
|
|
155
|
-
//# sourceMappingURL=oidcClientTsUserToTokens.js.map
|
|
155
|
+
//# sourceMappingURL=oidcClientTsUserToTokens.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Deferred } from "../tools/Deferred
|
|
2
|
-
import { assert, id } from "../vendor/frontend/tsafe
|
|
1
|
+
import { Deferred } from "../tools/Deferred";
|
|
2
|
+
import { assert, id } from "../vendor/frontend/tsafe";
|
|
3
3
|
const globalContext = {
|
|
4
4
|
prDone_arr: id([]),
|
|
5
5
|
prUnlock: id(Promise.resolve())
|
|
@@ -26,4 +26,4 @@ export async function waitForAllOtherOngoingLoginOrRefreshProcessesToComplete(pa
|
|
|
26
26
|
})();
|
|
27
27
|
await Promise.all(globalContext.prDone_arr);
|
|
28
28
|
}
|
|
29
|
-
//# sourceMappingURL=ongoingLoginOrRefreshProcesses.js.map
|
|
29
|
+
//# sourceMappingURL=ongoingLoginOrRefreshProcesses.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { typeGuard, id } from "../vendor/frontend/tsafe
|
|
1
|
+
import { typeGuard, id } from "../vendor/frontend/tsafe";
|
|
2
2
|
function getKey(params) {
|
|
3
3
|
const { configId } = params;
|
|
4
4
|
return `oidc-spa:auth-state:${configId}`;
|
|
@@ -61,4 +61,4 @@ export function getPersistedAuthState(params) {
|
|
|
61
61
|
}
|
|
62
62
|
return state.stateDescription;
|
|
63
63
|
}
|
|
64
|
-
//# sourceMappingURL=persistedAuthState.js.map
|
|
64
|
+
//# sourceMappingURL=persistedAuthState.js.map
|
package/esm/entrypoint.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { handleOidcCallback, moveRedirectAuthResponseFromSessionStorageToMemory } from "./core/handleOidcCallback
|
|
2
|
-
import { preventSessionStorageSetItemOfPublicKeyByThirdParty } from "./core/iframeMessageProtection
|
|
1
|
+
import { handleOidcCallback, moveRedirectAuthResponseFromSessionStorageToMemory } from "./core/handleOidcCallback";
|
|
2
|
+
import { preventSessionStorageSetItemOfPublicKeyByThirdParty } from "./core/iframeMessageProtection";
|
|
3
3
|
export function oidcEarlyInit(params) {
|
|
4
4
|
const { freezeFetch, freezeXMLHttpRequest, freezeWebSocket = false } = params ?? {};
|
|
5
5
|
const { isHandled } = handleOidcCallback();
|
|
@@ -43,4 +43,4 @@ export function oidcEarlyInit(params) {
|
|
|
43
43
|
}
|
|
44
44
|
return { shouldLoadApp };
|
|
45
45
|
}
|
|
46
|
-
//# sourceMappingURL=entrypoint.js.map
|
|
46
|
+
//# sourceMappingURL=entrypoint.js.map
|
package/esm/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { type Oidc, OidcInitializationError, type ParamsOfCreateOidc, createOidc } from "./core
|
|
1
|
+
export { type Oidc, OidcInitializationError, type ParamsOfCreateOidc, createOidc } from "./core";
|
package/esm/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { OidcInitializationError, createOidc } from "./core
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { OidcInitializationError, createOidc } from "./core";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/esm/keycloak/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { isKeycloak } from "./isKeycloak
|
|
2
|
-
export type { KeycloakIssuerUriParsed } from "./keycloakIssuerUriParsed
|
|
3
|
-
export { type KeycloakUtils, KeycloakProfile, KeycloakUserInfo, createKeycloakUtils } from "./keycloakUtils
|
|
1
|
+
export { isKeycloak } from "./isKeycloak";
|
|
2
|
+
export type { KeycloakIssuerUriParsed } from "./keycloakIssuerUriParsed";
|
|
3
|
+
export { type KeycloakUtils, KeycloakProfile, KeycloakUserInfo, createKeycloakUtils } from "./keycloakUtils";
|
package/esm/keycloak/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { isKeycloak } from "./isKeycloak
|
|
2
|
-
export { createKeycloakUtils } from "./keycloakUtils
|
|
3
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { isKeycloak } from "./isKeycloak";
|
|
2
|
+
export { createKeycloakUtils } from "./keycloakUtils";
|
|
3
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { KeycloakServerConfig, KeycloakInitOptions, KeycloakError, KeycloakLogoutOptions, KeycloakRoles, KeycloakTokenParsed, KeycloakResourceAccess, KeycloakProfile, KeycloakUserInfo, KeycloakLoginOptions, KeycloakRegisterOptions, KeycloakAccountOptions } from "./types
|
|
1
|
+
import type { KeycloakServerConfig, KeycloakInitOptions, KeycloakError, KeycloakLogoutOptions, KeycloakRoles, KeycloakTokenParsed, KeycloakResourceAccess, KeycloakProfile, KeycloakUserInfo, KeycloakLoginOptions, KeycloakRegisterOptions, KeycloakAccountOptions } from "./types";
|
|
2
2
|
type ConstructorParams = KeycloakServerConfig & {
|
|
3
3
|
homeUrl: string;
|
|
4
4
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { assert, is, isAmong } from "../../vendor/frontend/tsafe
|
|
2
|
-
import { createOidc, OidcInitializationError } from "../../core
|
|
3
|
-
import { Deferred } from "../../tools/Deferred
|
|
4
|
-
import { decodeJwt } from "../../tools/decodeJwt
|
|
5
|
-
import { createKeycloakUtils } from "../keycloakUtils
|
|
6
|
-
import { workerTimers } from "../../vendor/frontend/worker-timers
|
|
7
|
-
import { createStatefulEvt } from "../../tools/StatefulEvt
|
|
8
|
-
import { readExpirationTimeInJwt } from "../../tools/readExpirationTimeInJwt
|
|
1
|
+
import { assert, is, isAmong } from "../../vendor/frontend/tsafe";
|
|
2
|
+
import { createOidc, OidcInitializationError } from "../../core";
|
|
3
|
+
import { Deferred } from "../../tools/Deferred";
|
|
4
|
+
import { decodeJwt } from "../../tools/decodeJwt";
|
|
5
|
+
import { createKeycloakUtils } from "../keycloakUtils";
|
|
6
|
+
import { workerTimers } from "../../vendor/frontend/worker-timers";
|
|
7
|
+
import { createStatefulEvt } from "../../tools/StatefulEvt";
|
|
8
|
+
import { readExpirationTimeInJwt } from "../../tools/readExpirationTimeInJwt";
|
|
9
9
|
const internalStateByInstance = new WeakMap();
|
|
10
10
|
/**
|
|
11
11
|
* This module provides a drop-in replacement for `keycloak-js`,
|
|
@@ -771,4 +771,4 @@ export class Keycloak {
|
|
|
771
771
|
return (internalState.userInfo = await keycloakUtils.fetchUserInfo({ accessToken }));
|
|
772
772
|
}
|
|
773
773
|
}
|
|
774
|
-
//# sourceMappingURL=Keycloak.js.map
|
|
774
|
+
//# sourceMappingURL=Keycloak.js.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export type * from "./types
|
|
2
|
-
export { Keycloak } from "./Keycloak
|
|
1
|
+
export type * from "./types";
|
|
2
|
+
export { Keycloak } from "./Keycloak";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Keycloak } from "./Keycloak
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { Keycloak } from "./Keycloak";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { assert } from "../vendor/frontend/tsafe
|
|
2
|
-
import { isKeycloak } from "./isKeycloak
|
|
1
|
+
import { assert } from "../vendor/frontend/tsafe";
|
|
2
|
+
import { isKeycloak } from "./isKeycloak";
|
|
3
3
|
export function parseKeycloakIssuerUri(params) {
|
|
4
4
|
const { issuerUri } = params;
|
|
5
5
|
assert(isKeycloak({ issuerUri }));
|
|
@@ -13,4 +13,4 @@ export function parseKeycloakIssuerUri(params) {
|
|
|
13
13
|
kcHttpRelativePath: kcHttpRelativePath === "" ? undefined : kcHttpRelativePath
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
//# sourceMappingURL=keycloakIssuerUriParsed.js.map
|
|
16
|
+
//# sourceMappingURL=keycloakIssuerUriParsed.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl
|
|
2
|
-
import { parseKeycloakIssuerUri } from "./keycloakIssuerUriParsed
|
|
1
|
+
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl";
|
|
2
|
+
import { parseKeycloakIssuerUri } from "./keycloakIssuerUriParsed";
|
|
3
3
|
export function createKeycloakUtils(params) {
|
|
4
4
|
const { issuerUri } = params;
|
|
5
5
|
const issuerUriParsed = parseKeycloakIssuerUri({ issuerUri });
|
|
@@ -41,4 +41,4 @@ export function createKeycloakUtils(params) {
|
|
|
41
41
|
}
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
//# sourceMappingURL=keycloakUtils.js.map
|
|
44
|
+
//# sourceMappingURL=keycloakUtils.js.map
|
package/esm/keycloak-js.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./keycloak/keycloak-js
|
|
1
|
+
export * from "./keycloak/keycloak-js";
|
package/esm/keycloak-js.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./keycloak/keycloak-js
|
|
2
|
-
//# sourceMappingURL=keycloak-js.js.map
|
|
1
|
+
export * from "./keycloak/keycloak-js";
|
|
2
|
+
//# sourceMappingURL=keycloak-js.js.map
|
package/esm/mock/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./oidc
|
|
1
|
+
export * from "./oidc";
|
package/esm/mock/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./oidc
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from "./oidc";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/esm/mock/oidc.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Oidc } from "../core
|
|
1
|
+
import type { Oidc } from "../core";
|
|
2
2
|
export type ParamsOfCreateMockOidc<DecodedIdToken extends Record<string, unknown> = Record<string, unknown>, AutoLogin extends boolean = false> = {
|
|
3
3
|
mockedParams?: Partial<Oidc["params"]>;
|
|
4
4
|
mockedTokens?: Partial<Oidc.Tokens<DecodedIdToken>>;
|
package/esm/mock/oidc.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { createObjectThatThrowsIfAccessed } from "../tools/createObjectThatThrowsIfAccessed
|
|
2
|
-
import { id } from "../vendor/frontend/tsafe
|
|
3
|
-
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl
|
|
4
|
-
import { getSearchParam, addOrUpdateSearchParam } from "../tools/urlSearchParams
|
|
5
|
-
import { initialLocationHref } from "../core/initialLocationHref
|
|
1
|
+
import { createObjectThatThrowsIfAccessed } from "../tools/createObjectThatThrowsIfAccessed";
|
|
2
|
+
import { id } from "../vendor/frontend/tsafe";
|
|
3
|
+
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl";
|
|
4
|
+
import { getSearchParam, addOrUpdateSearchParam } from "../tools/urlSearchParams";
|
|
5
|
+
import { initialLocationHref } from "../core/initialLocationHref";
|
|
6
6
|
const URL_SEARCH_PARAM_NAME = "isUserLoggedIn";
|
|
7
7
|
export async function createMockOidc(params) {
|
|
8
8
|
const { isUserInitiallyLoggedIn = true, mockedParams = {}, mockedTokens = {}, homeUrl: homeUrl_params, autoLogin = false, postLoginRedirectUrl } = params;
|
|
@@ -148,4 +148,4 @@ export async function createMockOidc(params) {
|
|
|
148
148
|
};
|
|
149
149
|
return oidc;
|
|
150
150
|
}
|
|
151
|
-
//# sourceMappingURL=oidc.js.map
|
|
151
|
+
//# sourceMappingURL=oidc.js.map
|
package/esm/mock/react.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { type ParamsOfCreateMockOidc } from "./oidc
|
|
2
|
-
import type { ValueOrAsyncGetter } from "../tools/ValueOrAsyncGetter
|
|
1
|
+
import { type ParamsOfCreateMockOidc } from "./oidc";
|
|
2
|
+
import type { ValueOrAsyncGetter } from "../tools/ValueOrAsyncGetter";
|
|
3
3
|
/** @see: https://docs.oidc-spa.dev/v/v7/mock */
|
|
4
4
|
export declare function createMockReactOidc<DecodedIdToken extends Record<string, unknown> = Record<string, unknown>, AutoLogin extends boolean = false>(params: ValueOrAsyncGetter<ParamsOfCreateMockOidc<DecodedIdToken, AutoLogin>>): {
|
|
5
5
|
OidcProvider: (ParamsOfCreateMockOidc<DecodedIdToken, AutoLogin> extends infer T ? T extends ParamsOfCreateMockOidc<DecodedIdToken, AutoLogin> ? T extends {
|
|
@@ -9,7 +9,7 @@ export declare function createMockReactOidc<DecodedIdToken extends Record<string
|
|
|
9
9
|
} ? true : false : never : never) ? T_1 extends true ? (props: {
|
|
10
10
|
fallback?: import("react").ReactNode;
|
|
11
11
|
ErrorFallback?: (props: {
|
|
12
|
-
initializationError: import("
|
|
12
|
+
initializationError: import("..").OidcInitializationError;
|
|
13
13
|
}) => import("react").ReactNode;
|
|
14
14
|
children: import("react").ReactNode;
|
|
15
15
|
}) => import("react").JSX.Element : (props: {
|
|
@@ -22,22 +22,22 @@ export declare function createMockReactOidc<DecodedIdToken extends Record<string
|
|
|
22
22
|
autoLogin?: true | undefined;
|
|
23
23
|
} ? true : false : never : never) ? T_4 extends true ? (params?: {
|
|
24
24
|
assert: "user logged in";
|
|
25
|
-
}) => import("../react/react
|
|
25
|
+
}) => import("../react/react").OidcReact.LoggedIn<DecodedIdToken> : {
|
|
26
26
|
(params?: {
|
|
27
27
|
assert?: undefined;
|
|
28
|
-
}): import("../react/react
|
|
28
|
+
}): import("../react/react").OidcReact<DecodedIdToken>;
|
|
29
29
|
(params: {
|
|
30
30
|
assert: "user logged in";
|
|
31
|
-
}): import("../react/react
|
|
31
|
+
}): import("../react/react").OidcReact.LoggedIn<DecodedIdToken>;
|
|
32
32
|
(params: {
|
|
33
33
|
assert: "user not logged in";
|
|
34
|
-
}): import("../react/react
|
|
34
|
+
}): import("../react/react").OidcReact.NotLoggedIn;
|
|
35
35
|
} : never : never;
|
|
36
36
|
getOidc: () => Promise<(ParamsOfCreateMockOidc<DecodedIdToken, AutoLogin> extends infer T_6 ? T_6 extends ParamsOfCreateMockOidc<DecodedIdToken, AutoLogin> ? T_6 extends {
|
|
37
37
|
autoLogin?: true | undefined;
|
|
38
38
|
} ? true : false : never : never) extends infer T_7 ? T_7 extends (ParamsOfCreateMockOidc<DecodedIdToken, AutoLogin> extends infer T_8 ? T_8 extends ParamsOfCreateMockOidc<DecodedIdToken, AutoLogin> ? T_8 extends {
|
|
39
39
|
autoLogin?: true | undefined;
|
|
40
|
-
} ? true : false : never : never) ? T_7 extends true ? import("
|
|
40
|
+
} ? true : false : never : never) ? T_7 extends true ? import("..").Oidc.LoggedIn<DecodedIdToken> : import("..").Oidc<DecodedIdToken> : never : never>;
|
|
41
41
|
} & ((ParamsOfCreateMockOidc<DecodedIdToken, AutoLogin> extends infer T_6 ? T_6 extends ParamsOfCreateMockOidc<DecodedIdToken, AutoLogin> ? T_6 extends {
|
|
42
42
|
autoLogin?: true | undefined;
|
|
43
43
|
} ? true : false : never : never) extends infer T_7 ? T_7 extends (ParamsOfCreateMockOidc<DecodedIdToken, AutoLogin> extends infer T_8 ? T_8 extends ParamsOfCreateMockOidc<DecodedIdToken, AutoLogin> ? T_8 extends {
|
package/esm/mock/react.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { createOidcReactApi_dependencyInjection } from "../react/react
|
|
2
|
-
import { createMockOidc } from "./oidc
|
|
1
|
+
import { createOidcReactApi_dependencyInjection } from "../react/react";
|
|
2
|
+
import { createMockOidc } from "./oidc";
|
|
3
3
|
/** @see: https://docs.oidc-spa.dev/v/v7/mock */
|
|
4
4
|
export function createMockReactOidc(params) {
|
|
5
5
|
return createOidcReactApi_dependencyInjection(params, createMockOidc);
|
|
6
6
|
}
|
|
7
|
-
//# sourceMappingURL=react.js.map
|
|
7
|
+
//# sourceMappingURL=react.js.map
|
package/esm/react/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { type OidcReact, createReactOidc } from "./react
|
|
1
|
+
export { type OidcReact, createReactOidc } from "./react";
|
package/esm/react/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { createReactOidc } from "./react
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { createReactOidc } from "./react";
|
|
2
|
+
//# sourceMappingURL=index.js.map
|
package/esm/react/react.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type ReactNode, type ComponentType, type FC, type JSX } from "react";
|
|
2
|
-
import { type Oidc, type ParamsOfCreateOidc, OidcInitializationError } from "../core
|
|
3
|
-
import type { ValueOrAsyncGetter } from "../tools/ValueOrAsyncGetter
|
|
2
|
+
import { type Oidc, type ParamsOfCreateOidc, OidcInitializationError } from "../core";
|
|
3
|
+
import type { ValueOrAsyncGetter } from "../tools/ValueOrAsyncGetter";
|
|
4
4
|
export type OidcReact<DecodedIdToken extends Record<string, unknown>> = OidcReact.NotLoggedIn | OidcReact.LoggedIn<DecodedIdToken>;
|
|
5
5
|
export declare namespace OidcReact {
|
|
6
6
|
type Common = Oidc.Common & {
|
package/esm/react/react.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { Fragment as _Fragment, jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect, useState, createContext, useContext } from "react";
|
|
3
|
-
import { createOidc, OidcInitializationError, handleOidcCallback } from "../core
|
|
4
|
-
import { assert } from "../vendor/frontend/tsafe
|
|
5
|
-
import { id } from "../vendor/frontend/tsafe
|
|
6
|
-
import { Deferred } from "../tools/Deferred
|
|
7
|
-
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl
|
|
3
|
+
import { createOidc, OidcInitializationError, handleOidcCallback } from "../core";
|
|
4
|
+
import { assert } from "../vendor/frontend/tsafe";
|
|
5
|
+
import { id } from "../vendor/frontend/tsafe";
|
|
6
|
+
import { Deferred } from "../tools/Deferred";
|
|
7
|
+
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl";
|
|
8
8
|
{
|
|
9
9
|
assert();
|
|
10
10
|
}
|
|
@@ -218,4 +218,4 @@ export function createOidcReactApi_dependencyInjection(paramsOrGetParams, create
|
|
|
218
218
|
export function createReactOidc(params) {
|
|
219
219
|
return createOidcReactApi_dependencyInjection(params, createOidc);
|
|
220
220
|
}
|
|
221
|
-
//# sourceMappingURL=react.js.map
|
|
221
|
+
//# sourceMappingURL=react.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assert, typeGuard, id } from "../vendor/frontend/tsafe
|
|
1
|
+
import { assert, typeGuard, id } from "../vendor/frontend/tsafe";
|
|
2
2
|
function parseSessionStorageItem(sessionStorageItemValue) {
|
|
3
3
|
let json;
|
|
4
4
|
try {
|
|
@@ -138,4 +138,4 @@ export function createEphemeralSessionStorage(params) {
|
|
|
138
138
|
};
|
|
139
139
|
return storage;
|
|
140
140
|
}
|
|
141
|
-
//# sourceMappingURL=EphemeralSessionStorage.js.map
|
|
141
|
+
//# sourceMappingURL=EphemeralSessionStorage.js.map
|
package/esm/tools/Evt.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Deferred } from "./Deferred
|
|
2
|
-
import { assert, is } from "../vendor/frontend/tsafe
|
|
1
|
+
import { Deferred } from "./Deferred";
|
|
2
|
+
import { assert, is } from "../vendor/frontend/tsafe";
|
|
3
3
|
export function createEvt() {
|
|
4
4
|
const eventTarget = new EventTarget();
|
|
5
5
|
const KEY = "event";
|
|
@@ -35,4 +35,4 @@ export function createEvt() {
|
|
|
35
35
|
};
|
|
36
36
|
return evt;
|
|
37
37
|
}
|
|
38
|
-
//# sourceMappingURL=Evt.js.map
|
|
38
|
+
//# sourceMappingURL=Evt.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { assert } from "../vendor/frontend/tsafe
|
|
1
|
+
import { assert } from "../vendor/frontend/tsafe";
|
|
2
2
|
export function getDownlinkAndRtt() {
|
|
3
3
|
if (!(window.navigator instanceof Object)) {
|
|
4
4
|
return undefined;
|
|
@@ -15,4 +15,4 @@ export function getDownlinkAndRtt() {
|
|
|
15
15
|
}
|
|
16
16
|
return undefined;
|
|
17
17
|
}
|
|
18
|
-
//# sourceMappingURL=getDownlinkAndRtt.js.map
|
|
18
|
+
//# sourceMappingURL=getDownlinkAndRtt.js.map
|
package/esm/tools/getIsOnline.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Deferred } from "../tools/Deferred
|
|
1
|
+
import { Deferred } from "../tools/Deferred";
|
|
2
2
|
export function getIsOnline() {
|
|
3
3
|
if (navigator.onLine) {
|
|
4
4
|
return { isOnline: true };
|
|
@@ -11,4 +11,4 @@ export function getIsOnline() {
|
|
|
11
11
|
window.addEventListener("online", onOnline);
|
|
12
12
|
return { isOnline: false, prOnline: dOnline.pr };
|
|
13
13
|
}
|
|
14
|
-
//# sourceMappingURL=getIsOnline.js.map
|
|
14
|
+
//# sourceMappingURL=getIsOnline.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Deferred } from "./Deferred
|
|
1
|
+
import { Deferred } from "./Deferred";
|
|
2
2
|
export function getPrUserInteraction() {
|
|
3
3
|
const d = new Deferred();
|
|
4
4
|
const callback = () => {
|
|
@@ -20,4 +20,4 @@ export function getPrUserInteraction() {
|
|
|
20
20
|
cancelPrUserInteraction: cleanup
|
|
21
21
|
};
|
|
22
22
|
}
|
|
23
|
-
//# sourceMappingURL=getPrUserInteraction.js.map
|
|
23
|
+
//# sourceMappingURL=getPrUserInteraction.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { isKeycloak, createKeycloakUtils } from "../keycloak
|
|
1
|
+
import { isKeycloak, createKeycloakUtils } from "../keycloak";
|
|
2
2
|
/**
|
|
3
3
|
* @deprecated: Use `import { ... } from "oidc-spa/keycloak"` instead.
|
|
4
4
|
*
|
|
@@ -30,4 +30,4 @@ export function parseKeycloakIssuerUri(issuerUri) {
|
|
|
30
30
|
getAccountUrl: keycloakUtils.getAccountUrl
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
//# sourceMappingURL=parseKeycloakIssuerUri.js.map
|
|
33
|
+
//# sourceMappingURL=parseKeycloakIssuerUri.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { decodeJwt } from "./decodeJwt
|
|
2
|
-
import { assert } from "../vendor/frontend/tsafe
|
|
1
|
+
import { decodeJwt } from "./decodeJwt";
|
|
2
|
+
import { assert } from "../vendor/frontend/tsafe";
|
|
3
3
|
// Return undefined if token provided wasn't a JWT or if it hasn't an exp claim number
|
|
4
4
|
export function readExpirationTimeInJwt(token) {
|
|
5
5
|
let exp;
|
|
@@ -12,4 +12,4 @@ export function readExpirationTimeInJwt(token) {
|
|
|
12
12
|
}
|
|
13
13
|
return exp * 1000;
|
|
14
14
|
}
|
|
15
|
-
//# sourceMappingURL=readExpirationTimeInJwt.js.map
|
|
15
|
+
//# sourceMappingURL=readExpirationTimeInJwt.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { setTimeout, clearTimeout } from "../tools/workerTimers
|
|
1
|
+
import { setTimeout, clearTimeout } from "../tools/workerTimers";
|
|
2
2
|
export function createStartCountdown(params) {
|
|
3
3
|
const { tickCallback } = params;
|
|
4
4
|
function startCountdown(params) {
|
|
@@ -22,4 +22,4 @@ export function createStartCountdown(params) {
|
|
|
22
22
|
}
|
|
23
23
|
return { startCountdown };
|
|
24
24
|
}
|
|
25
|
-
//# sourceMappingURL=startCountdown.js.map
|
|
25
|
+
//# sourceMappingURL=startCountdown.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { getPrUserInteraction } from "./getPrUserInteraction
|
|
1
|
+
import { getPrUserInteraction } from "./getPrUserInteraction";
|
|
2
2
|
export function subscribeToUserInteraction(params) {
|
|
3
3
|
const { throttleMs } = params;
|
|
4
4
|
const cleanups = new Set();
|
|
@@ -21,4 +21,4 @@ export function subscribeToUserInteraction(params) {
|
|
|
21
21
|
};
|
|
22
22
|
return { unsubscribeFromUserInteraction };
|
|
23
23
|
}
|
|
24
|
-
//# sourceMappingURL=subscribeToUserInteraction.js.map
|
|
24
|
+
//# sourceMappingURL=subscribeToUserInteraction.js.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { workerTimers } from "../vendor/frontend/worker-timers
|
|
1
|
+
import { workerTimers } from "../vendor/frontend/worker-timers";
|
|
2
2
|
const clearByTimerHandle = new WeakMap();
|
|
3
3
|
export function setTimeout(callback, delay) {
|
|
4
4
|
const callback_actual = () => {
|
|
@@ -34,4 +34,4 @@ export function clearTimeout(handle) {
|
|
|
34
34
|
}
|
|
35
35
|
clear();
|
|
36
36
|
}
|
|
37
|
-
//# sourceMappingURL=workerTimers.js.map
|
|
37
|
+
//# sourceMappingURL=workerTimers.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "oidc-spa",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.3",
|
|
4
4
|
"description": "Openidconnect client for Single Page Applications",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -40,62 +40,40 @@
|
|
|
40
40
|
"module": "esm/index.js",
|
|
41
41
|
"exports": {
|
|
42
42
|
".": {
|
|
43
|
-
"
|
|
44
|
-
"import": "./esm/index.js",
|
|
45
|
-
"require": "./index.js",
|
|
43
|
+
"module": "./esm/index.js",
|
|
46
44
|
"default": "./index.js"
|
|
47
45
|
},
|
|
48
46
|
"./mock": {
|
|
49
|
-
"
|
|
50
|
-
"import": "./esm/mock/index.js",
|
|
51
|
-
"require": "./mock/index.js",
|
|
47
|
+
"module": "./esm/mock/index.js",
|
|
52
48
|
"default": "./mock/index.js"
|
|
53
49
|
},
|
|
54
50
|
"./react": {
|
|
55
|
-
"
|
|
56
|
-
"import": "./esm/react/index.js",
|
|
57
|
-
"require": "./react/index.js",
|
|
51
|
+
"module": "./esm/react/index.js",
|
|
58
52
|
"default": "./react/index.js"
|
|
59
53
|
},
|
|
60
54
|
"./mock/react": {
|
|
61
|
-
"
|
|
62
|
-
"import": "./esm/mock/react.js",
|
|
63
|
-
"require": "./mock/react.js",
|
|
55
|
+
"module": "./esm/mock/react.js",
|
|
64
56
|
"default": "./mock/react.js"
|
|
65
57
|
},
|
|
66
58
|
"./entrypoint": {
|
|
67
|
-
"
|
|
68
|
-
"import": "./esm/entrypoint.js",
|
|
69
|
-
"require": "./entrypoint.js",
|
|
59
|
+
"module": "./esm/entrypoint.js",
|
|
70
60
|
"default": "./entrypoint.js"
|
|
71
61
|
},
|
|
72
|
-
"./backend":
|
|
73
|
-
"types": "./backend.d.ts",
|
|
74
|
-
"require": "./backend.js",
|
|
75
|
-
"default": "./backend.js"
|
|
76
|
-
},
|
|
62
|
+
"./backend": "./backend.js",
|
|
77
63
|
"./keycloak": {
|
|
78
|
-
"
|
|
79
|
-
"import": "./esm/keycloak/index.js",
|
|
80
|
-
"require": "./keycloak/index.js",
|
|
64
|
+
"module": "./esm/keycloak/index.js",
|
|
81
65
|
"default": "./keycloak/index.js"
|
|
82
66
|
},
|
|
83
67
|
"./keycloak-js": {
|
|
84
|
-
"
|
|
85
|
-
"import": "./esm/keycloak-js.js",
|
|
86
|
-
"require": "./keycloak-js.js",
|
|
68
|
+
"module": "./esm/keycloak-js.js",
|
|
87
69
|
"default": "./keycloak-js.js"
|
|
88
70
|
},
|
|
89
71
|
"./tools/decodeJwt": {
|
|
90
|
-
"
|
|
91
|
-
"import": "./esm/tools/decodeJwt.js",
|
|
92
|
-
"require": "./tools/decodeJwt.js",
|
|
72
|
+
"module": "./esm/tools/decodeJwt.js",
|
|
93
73
|
"default": "./tools/decodeJwt.js"
|
|
94
74
|
},
|
|
95
75
|
"./tools/parseKeycloakIssuerUri": {
|
|
96
|
-
"
|
|
97
|
-
"import": "./esm/tools/parseKeycloakIssuerUri.js",
|
|
98
|
-
"require": "./tools/parseKeycloakIssuerUri.js",
|
|
76
|
+
"module": "./esm/tools/parseKeycloakIssuerUri.js",
|
|
99
77
|
"default": "./tools/parseKeycloakIssuerUri.js"
|
|
100
78
|
}
|
|
101
79
|
}
|