oidc-spa 7.2.0-rc.3 → 7.2.1
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/core/loginSilent.js +39 -14
- package/core/loginSilent.js.map +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 +47 -22
- package/esm/core/loginSilent.js.map +1 -1
- 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 +1 -1
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.1";
|
|
67
67
|
const globalContext = {
|
|
68
68
|
prOidcByConfigId: new Map(),
|
|
69
69
|
hasLogoutBeenCalled: (0, tsafe_1.id)(false),
|
package/core/loginSilent.js
CHANGED
|
@@ -12,13 +12,10 @@ async function loginSilent(params) {
|
|
|
12
12
|
const { oidcClientTsUserManager, stateUrlParamValue_instance, configId, transformUrlBeforeRedirect, getExtraQueryParams, getExtraTokenParams, autoLogin } = params;
|
|
13
13
|
const dResult = new Deferred_1.Deferred();
|
|
14
14
|
const timeoutDelayMs = (() => {
|
|
15
|
-
if (autoLogin) {
|
|
16
|
-
return 25000;
|
|
17
|
-
}
|
|
18
|
-
const downlinkAndRtt = (0, getDownlinkAndRtt_1.getDownlinkAndRtt)();
|
|
19
15
|
const isDev = (0, isDev_1.getIsDev)();
|
|
16
|
+
const downlinkAndRtt = (0, getDownlinkAndRtt_1.getDownlinkAndRtt)();
|
|
20
17
|
// Base delay is the minimum delay we should wait in any case
|
|
21
|
-
const BASE_DELAY_MS = isDev ? 9000 : 7000;
|
|
18
|
+
const BASE_DELAY_MS = isDev ? 9000 : autoLogin ? 25000 : 7000;
|
|
22
19
|
if (downlinkAndRtt === undefined) {
|
|
23
20
|
return BASE_DELAY_MS;
|
|
24
21
|
}
|
|
@@ -31,12 +28,36 @@ async function loginSilent(params) {
|
|
|
31
28
|
const { decodeEncryptedAuth, getIsEncryptedAuthResponse, clearSessionStoragePublicKey } = await (0, iframeMessageProtection_1.initIframeMessageProtection)({
|
|
32
29
|
stateUrlParamValue: stateUrlParamValue_instance
|
|
33
30
|
});
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
31
|
+
let clearTimeouts;
|
|
32
|
+
{
|
|
33
|
+
let hasLoggedWarningMessage = false;
|
|
34
|
+
const timeouts = [
|
|
35
|
+
setTimeout(() => {
|
|
36
|
+
dResult.resolve({
|
|
37
|
+
outcome: "failure",
|
|
38
|
+
cause: "timeout"
|
|
39
|
+
});
|
|
40
|
+
}, timeoutDelayMs),
|
|
41
|
+
setTimeout(() => {
|
|
42
|
+
console.warn([
|
|
43
|
+
"oidc-spa: Session restoration is taking longer than expected.",
|
|
44
|
+
"This likely indicates a misconfiguration.",
|
|
45
|
+
`Waiting ${Math.floor(timeoutDelayMs / 1000)} seconds before running diagnostics.`,
|
|
46
|
+
"Once the timeout expires, helpful debugging information will be printed to the console."
|
|
47
|
+
].join(" "));
|
|
48
|
+
hasLoggedWarningMessage = true;
|
|
49
|
+
}, 2000)
|
|
50
|
+
];
|
|
51
|
+
clearTimeouts = ({ wasSuccess }) => {
|
|
52
|
+
timeouts.forEach(clearTimeout);
|
|
53
|
+
if (wasSuccess && hasLoggedWarningMessage) {
|
|
54
|
+
console.log([
|
|
55
|
+
"oidc-spa: Never mind, the auth server was just slow to respond.",
|
|
56
|
+
"You can safely ignore the previous warning."
|
|
57
|
+
].join(" "));
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
40
61
|
const listener = async (event) => {
|
|
41
62
|
if (event.origin !== window.location.origin) {
|
|
42
63
|
return;
|
|
@@ -53,7 +74,7 @@ async function loginSilent(params) {
|
|
|
53
74
|
if (stateData.configId !== configId) {
|
|
54
75
|
return;
|
|
55
76
|
}
|
|
56
|
-
|
|
77
|
+
clearTimeouts({ wasSuccess: true });
|
|
57
78
|
window.removeEventListener("message", listener);
|
|
58
79
|
dResult.resolve({
|
|
59
80
|
outcome: "got auth response from iframe",
|
|
@@ -94,7 +115,7 @@ async function loginSilent(params) {
|
|
|
94
115
|
})
|
|
95
116
|
.then(oidcClientTsUser => {
|
|
96
117
|
(0, tsafe_1.assert)(oidcClientTsUser !== null, "oidcClientTsUser is not supposed to be null here");
|
|
97
|
-
|
|
118
|
+
clearTimeouts({ wasSuccess: true });
|
|
98
119
|
window.removeEventListener("message", listener);
|
|
99
120
|
dResult.resolve({
|
|
100
121
|
outcome: "token refreshed using refresh token",
|
|
@@ -107,7 +128,11 @@ async function loginSilent(params) {
|
|
|
107
128
|
// This usually means that the server is down or that the issuerUri
|
|
108
129
|
// is not pointing to a valid oidc server.
|
|
109
130
|
// It could be a CORS error on the well-known endpoint but it's unlikely.
|
|
110
|
-
|
|
131
|
+
// NOTE: This error should happen well before we displayed
|
|
132
|
+
// the warning notifying that something is probably misconfigured.
|
|
133
|
+
// wasSuccess shouldn't really be a required parameter but we do it
|
|
134
|
+
// for peace of mind.
|
|
135
|
+
clearTimeouts({ wasSuccess: false });
|
|
111
136
|
dResult.resolve({
|
|
112
137
|
outcome: "failure",
|
|
113
138
|
cause: "can't reach well-known oidc endpoint"
|
package/core/loginSilent.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loginSilent.js","sourceRoot":"","sources":["../../src/core/loginSilent.ts"],"names":[],"mappings":";;AA2BA,
|
|
1
|
+
{"version":3,"file":"loginSilent.js","sourceRoot":"","sources":["../../src/core/loginSilent.ts"],"names":[],"mappings":";;AA2BA,kCAsNC;AA7OD,gDAA6C;AAC7C,oDAAmE;AACnE,2CAA4E;AAC5E,kEAA+D;AAC/D,0CAA0C;AAE1C,8DAAkE;AAClE,uEAAwE;AAgBjE,KAAK,UAAU,WAAW,CAAC,MAejC;IACG,MAAM,EACF,uBAAuB,EACvB,2BAA2B,EAC3B,QAAQ,EACR,0BAA0B,EAC1B,mBAAmB,EACnB,mBAAmB,EACnB,SAAS,EACZ,GAAG,MAAM,CAAC;IAEX,MAAM,OAAO,GAAG,IAAI,mBAAQ,EAAuB,CAAC;IAEpD,MAAM,cAAc,GAAW,CAAC,GAAG,EAAE;QACjC,MAAM,KAAK,GAAG,IAAA,gBAAQ,GAAE,CAAC;QAEzB,MAAM,cAAc,GAAG,IAAA,qCAAiB,GAAE,CAAC;QAE3C,6DAA6D;QAC7D,MAAM,aAAa,GAAG,KAAK,CAAC,CAAC,CAAC,IAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAM,CAAC,CAAC,CAAC,IAAK,CAAC;QAEjE,IAAI,cAAc,KAAK,SAAS,EAAE,CAAC;YAC/B,OAAO,aAAa,CAAC;QACzB,CAAC;QAED,MAAM,EAAE,QAAQ,EAAE,GAAG,EAAE,GAAG,cAAc,CAAC;QAEzC,oDAAoD;QACpD,8CAA8C;QAC9C,MAAM,YAAY,GAAG,GAAG,GAAG,G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;QACb,IAAI,KAAK,CAAC,OAAO,KAAK,iBAAiB,EAAE,CAAC;YACtC,+DAA+D;YAC/D,mCAAmC;YACnC,mEAAmE;YACnE,0CAA0C;YAC1C,yEAAyE;YAEzE,0DAA0D;YAC1D,kEAAkE;YAClE,mEAAmE;YACnE,qBAAqB;YACrB,aAAa,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;YAErC,OAAO,CAAC,OAAO,CAAC;gBACZ,OAAO,EAAE,SAAS;gBAClB,KAAK,EAAE,sCAAsC;aAChD,CAAC,CAAC;YAEH,OAAO;QACX,CAAC;QAED,yEAAyE;QACzE,qEAAqE;IACzE,CAAC,CACJ,CAAC;IAEN,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QACrB,4BAA4B,EAAE,CAAC;QAE/B,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC/B,IAAA,2BAAe,EAAC,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,CAAC,CAAC;QACzE,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,EAAE,CAAC;AACtB,CAAC"}
|
package/esm/core/AuthResponse.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { addOrUpdateSearchParam } from "../tools/urlSearchParams";
|
|
1
|
+
import { addOrUpdateSearchParam } from "../tools/urlSearchParams.js";
|
|
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.js";
|
|
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.js";
|
|
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.js";
|
|
2
|
+
import { generateUrlSafeRandom } from "../tools/generateUrlSafeRandom.js";
|
|
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.js";
|
|
2
|
+
import type { Oidc } from "./Oidc.js";
|
|
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.js";
|
|
2
|
+
import { id, assert, is } from "../vendor/frontend/tsafe.js";
|
|
3
|
+
import { setTimeout, clearTimeout } from "../tools/workerTimers.js";
|
|
4
|
+
import { Deferred } from "../tools/Deferred.js";
|
|
5
|
+
import { createEvtIsUserActive } from "./evtIsUserActive.js";
|
|
6
|
+
import { createStartCountdown } from "../tools/startCountdown.js";
|
|
7
|
+
import { toHumanReadableDuration } from "../tools/toHumanReadableDuration.js";
|
|
8
|
+
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl.js";
|
|
9
|
+
import { OidcInitializationError } from "./OidcInitializationError.js";
|
|
10
|
+
import { generateStateUrlParamValue, STATE_STORE_KEY_PREFIX } from "./StateData.js";
|
|
11
|
+
import { notifyOtherTabsOfLogout, getPrOtherTabLogout } from "./logoutPropagationToOtherTabs.js";
|
|
12
|
+
import { notifyOtherTabsOfLogin, getPrOtherTabLogin } from "./loginPropagationToOtherTabs.js";
|
|
13
|
+
import { getConfigId } from "./configId.js";
|
|
14
|
+
import { oidcClientTsUserToTokens } from "./oidcClientTsUserToTokens.js";
|
|
15
|
+
import { loginSilent } from "./loginSilent.js";
|
|
16
|
+
import { authResponseToUrl } from "./AuthResponse.js";
|
|
17
|
+
import { handleOidcCallback, retrieveRedirectAuthResponseAndStateData } from "./handleOidcCallback.js";
|
|
18
|
+
import { getPersistedAuthState, persistAuthState } from "./persistedAuthState.js";
|
|
19
|
+
import { createEvt } from "../tools/Evt.js";
|
|
20
|
+
import { getHaveSharedParentDomain } from "../tools/haveSharedParentDomain.js";
|
|
21
|
+
import { createLoginOrGoToAuthServer, getPrSafelyRestoredFromBfCacheAfterLoginBackNavigation } from "./loginOrGoToAuthServer.js";
|
|
22
|
+
import { createEphemeralSessionStorage } from "../tools/EphemeralSessionStorage.js";
|
|
23
|
+
import { startLoginOrRefreshProcess, waitForAllOtherOngoingLoginOrRefreshProcessesToComplete } from "./ongoingLoginOrRefreshProcesses.js";
|
|
24
|
+
import { initialLocationHref } from "./initialLocationHref.js";
|
|
25
|
+
import { createGetIsNewBrowserSession } from "./isNewBrowserSession.js";
|
|
26
|
+
import { getIsOnline } from "../tools/getIsOnline.js";
|
|
27
|
+
import { isKeycloak } from "../keycloak/isKeycloak.js";
|
|
28
28
|
// NOTE: Replaced at build time
|
|
29
|
-
const VERSION = "7.2.
|
|
29
|
+
const VERSION = "7.2.1";
|
|
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")).createFailedToFetchTokenEndpointInitializationError({
|
|
240
|
+
return (await import("./diagnostic.js")).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")).createWellKnownOidcConfigurationEndpointUnreachableInitializationError({
|
|
373
|
+
return (await import("./diagnostic.js")).createWellKnownOidcConfigurationEndpointUnreachableInitializationError({
|
|
374
374
|
issuerUri
|
|
375
375
|
});
|
|
376
376
|
case "timeout":
|
|
377
|
-
return (await import("./diagnostic")).createIframeTimeoutInitializationError({
|
|
377
|
+
return (await import("./diagnostic.js")).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")).createFailedToFetchTokenEndpointInitializationError({
|
|
396
|
+
return (await import("./diagnostic.js")).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.js";
|
|
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.js";
|
|
2
|
+
import { isKeycloak, createKeycloakUtils } from "../keycloak/index.js";
|
|
3
|
+
import { getIsValidRemoteJson } from "../tools/getIsValidRemoteJson.js";
|
|
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.js";
|
|
2
|
+
import { subscribeToUserInteraction } from "../tools/subscribeToUserInteraction.js";
|
|
3
|
+
import { assert, is, id } from "../vendor/frontend/tsafe.js";
|
|
4
|
+
import { setTimeout, clearTimeout } from "../tools/workerTimers.js";
|
|
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.js";
|
|
2
|
+
import type { AuthResponse } from "./AuthResponse.js";
|
|
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.js";
|
|
2
|
+
import { assert, id } from "../vendor/frontend/tsafe.js";
|
|
3
|
+
import { initialLocationHref } from "./initialLocationHref.js";
|
|
4
|
+
import { encryptAuthResponse } from "./iframeMessageProtection.js";
|
|
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.js";
|
|
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.js";
|
|
2
|
+
import { asymmetricEncrypt, asymmetricDecrypt, generateKeys } from "../tools/asymmetricEncryption.js";
|
|
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.js";
|
|
2
|
+
export { createOidc, type ParamsOfCreateOidc } from "./createOidc.js";
|
|
3
|
+
export { OidcInitializationError } from "./OidcInitializationError.js";
|
|
4
|
+
export { handleOidcCallback } from "./handleOidcCallback.js";
|
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.js";
|
|
2
|
+
export { OidcInitializationError } from "./OidcInitializationError.js";
|
|
3
|
+
export { handleOidcCallback } from "./handleOidcCallback.js";
|
|
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.js";
|
|
2
|
+
import type { NonPostableEvt } from "../tools/Evt.js";
|
|
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.js";
|
|
2
|
+
import { assert, noUndefined } from "../vendor/frontend/tsafe.js";
|
|
3
|
+
import { createStatefulEvt } from "../tools/StatefulEvt.js";
|
|
4
|
+
import { Deferred } from "../tools/Deferred.js";
|
|
5
|
+
import { addOrUpdateSearchParam, getAllSearchParams } from "../tools/urlSearchParams.js";
|
|
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.js";
|
|
2
|
+
import { Deferred } from "../tools/Deferred.js";
|
|
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.js";
|
|
2
|
+
import { type AuthResponse } from "./AuthResponse.js";
|
|
3
3
|
type ResultOfLoginSilent = {
|
|
4
4
|
outcome: "got auth response from iframe";
|
|
5
5
|
authResponse: AuthResponse;
|
package/esm/core/loginSilent.js
CHANGED
|
@@ -1,21 +1,18 @@
|
|
|
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.js";
|
|
2
|
+
import { id, assert, noUndefined } from "../vendor/frontend/tsafe.js";
|
|
3
|
+
import { getStateData, clearStateStore } from "./StateData.js";
|
|
4
|
+
import { getDownlinkAndRtt } from "../tools/getDownlinkAndRtt.js";
|
|
5
|
+
import { getIsDev } from "../tools/isDev.js";
|
|
6
|
+
import { addOrUpdateSearchParam } from "../tools/urlSearchParams.js";
|
|
7
|
+
import { initIframeMessageProtection } from "./iframeMessageProtection.js";
|
|
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();
|
|
11
11
|
const timeoutDelayMs = (() => {
|
|
12
|
-
if (autoLogin) {
|
|
13
|
-
return 25000;
|
|
14
|
-
}
|
|
15
|
-
const downlinkAndRtt = getDownlinkAndRtt();
|
|
16
12
|
const isDev = getIsDev();
|
|
13
|
+
const downlinkAndRtt = getDownlinkAndRtt();
|
|
17
14
|
// Base delay is the minimum delay we should wait in any case
|
|
18
|
-
const BASE_DELAY_MS = isDev ? 9000 : 7000;
|
|
15
|
+
const BASE_DELAY_MS = isDev ? 9000 : autoLogin ? 25000 : 7000;
|
|
19
16
|
if (downlinkAndRtt === undefined) {
|
|
20
17
|
return BASE_DELAY_MS;
|
|
21
18
|
}
|
|
@@ -28,12 +25,36 @@ export async function loginSilent(params) {
|
|
|
28
25
|
const { decodeEncryptedAuth, getIsEncryptedAuthResponse, clearSessionStoragePublicKey } = await initIframeMessageProtection({
|
|
29
26
|
stateUrlParamValue: stateUrlParamValue_instance
|
|
30
27
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
let clearTimeouts;
|
|
29
|
+
{
|
|
30
|
+
let hasLoggedWarningMessage = false;
|
|
31
|
+
const timeouts = [
|
|
32
|
+
setTimeout(() => {
|
|
33
|
+
dResult.resolve({
|
|
34
|
+
outcome: "failure",
|
|
35
|
+
cause: "timeout"
|
|
36
|
+
});
|
|
37
|
+
}, timeoutDelayMs),
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
console.warn([
|
|
40
|
+
"oidc-spa: Session restoration is taking longer than expected.",
|
|
41
|
+
"This likely indicates a misconfiguration.",
|
|
42
|
+
`Waiting ${Math.floor(timeoutDelayMs / 1000)} seconds before running diagnostics.`,
|
|
43
|
+
"Once the timeout expires, helpful debugging information will be printed to the console."
|
|
44
|
+
].join(" "));
|
|
45
|
+
hasLoggedWarningMessage = true;
|
|
46
|
+
}, 2000)
|
|
47
|
+
];
|
|
48
|
+
clearTimeouts = ({ wasSuccess }) => {
|
|
49
|
+
timeouts.forEach(clearTimeout);
|
|
50
|
+
if (wasSuccess && hasLoggedWarningMessage) {
|
|
51
|
+
console.log([
|
|
52
|
+
"oidc-spa: Never mind, the auth server was just slow to respond.",
|
|
53
|
+
"You can safely ignore the previous warning."
|
|
54
|
+
].join(" "));
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
}
|
|
37
58
|
const listener = async (event) => {
|
|
38
59
|
if (event.origin !== window.location.origin) {
|
|
39
60
|
return;
|
|
@@ -50,7 +71,7 @@ export async function loginSilent(params) {
|
|
|
50
71
|
if (stateData.configId !== configId) {
|
|
51
72
|
return;
|
|
52
73
|
}
|
|
53
|
-
|
|
74
|
+
clearTimeouts({ wasSuccess: true });
|
|
54
75
|
window.removeEventListener("message", listener);
|
|
55
76
|
dResult.resolve({
|
|
56
77
|
outcome: "got auth response from iframe",
|
|
@@ -91,7 +112,7 @@ export async function loginSilent(params) {
|
|
|
91
112
|
})
|
|
92
113
|
.then(oidcClientTsUser => {
|
|
93
114
|
assert(oidcClientTsUser !== null, "oidcClientTsUser is not supposed to be null here");
|
|
94
|
-
|
|
115
|
+
clearTimeouts({ wasSuccess: true });
|
|
95
116
|
window.removeEventListener("message", listener);
|
|
96
117
|
dResult.resolve({
|
|
97
118
|
outcome: "token refreshed using refresh token",
|
|
@@ -104,7 +125,11 @@ export async function loginSilent(params) {
|
|
|
104
125
|
// This usually means that the server is down or that the issuerUri
|
|
105
126
|
// is not pointing to a valid oidc server.
|
|
106
127
|
// It could be a CORS error on the well-known endpoint but it's unlikely.
|
|
107
|
-
|
|
128
|
+
// NOTE: This error should happen well before we displayed
|
|
129
|
+
// the warning notifying that something is probably misconfigured.
|
|
130
|
+
// wasSuccess shouldn't really be a required parameter but we do it
|
|
131
|
+
// for peace of mind.
|
|
132
|
+
clearTimeouts({ wasSuccess: false });
|
|
108
133
|
dResult.resolve({
|
|
109
134
|
outcome: "failure",
|
|
110
135
|
cause: "can't reach well-known oidc endpoint"
|
|
@@ -122,4 +147,4 @@ export async function loginSilent(params) {
|
|
|
122
147
|
});
|
|
123
148
|
return dResult.pr;
|
|
124
149
|
}
|
|
125
|
-
//# sourceMappingURL=loginSilent.js.map
|
|
150
|
+
//# sourceMappingURL=loginSilent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loginSilent.js","sourceRoot":"","sources":["../../../src/core/loginSilent.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,EAAE,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AACnE,OAAO,EAAE,YAAY,EAAE,eAAe,EAAkB,MAAM,aAAa,CAAC;AAC5E,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAE1C,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,OAAO,EAAE,2BAA2B,EAAE,MAAM,2BAA2B,CAAC;AAgBxE,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAejC;IACG,MAAM,EACF,uBAAuB,EACvB,2BAA2B,EAC3B,QAAQ,EACR,0BAA0B,EAC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AAO,EAAE,qCAAqC;YAC9C,gBAAgB;SACnB,CAAC,CAAC;IACP,CAAC,EACD,CAAC,KAAY,EAAE,EAAE;QACb,IAAI,KAAK,CAAC,OAAO,KAAK,iBAAiB,EAAE,CAAC;YACtC,+DAA+D;YAC/D,mCAAmC;YACnC,mEAAmE;YACnE,0CAA0C;YAC1C,yEAAyE;YAEzE,0DAA0D;YAC1D,kEAAkE;YAClE,mEAAmE;YACnE,qBAAqB;YACrB,aAAa,CAAC,EAAE,UAAU,EAAE,KAAK,EAAE,CAAC,CAAC;YAErC,OAAO,CAAC,OAAO,CAAC;gBACZ,OAAO,EAAE,SAAS;gBAClB,KAAK,EAAE,sCAAsC;aAChD,CAAC,CAAC;YAEH,OAAO;QACX,CAAC;QAED,yEAAyE;QACzE,qEAAqE;IACzE,CAAC,CACJ,CAAC;IAEN,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE;QACrB,4BAA4B,EAAE,CAAC;QAE/B,IAAI,MAAM,CAAC,OAAO,KAAK,SAAS,EAAE,CAAC;YAC/B,eAAe,CAAC,EAAE,kBAAkB,EAAE,2BAA2B,EAAE,CAAC,CAAC;QACzE,CAAC;IACL,CAAC,CAAC,CAAC;IAEH,OAAO,OAAO,CAAC,EAAE,CAAC;AACtB,CAAC"}
|
|
@@ -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.js";
|
|
2
|
+
import { Deferred } from "../tools/Deferred.js";
|
|
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.js";
|
|
2
|
+
import type { Oidc } from "./Oidc.js";
|
|
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.js";
|
|
2
|
+
import { readExpirationTimeInJwt } from "../tools/readExpirationTimeInJwt.js";
|
|
3
|
+
import { decodeJwt } from "../tools/decodeJwt.js";
|
|
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.js";
|
|
2
|
+
import { assert, id } from "../vendor/frontend/tsafe.js";
|
|
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.js";
|
|
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.js";
|
|
2
|
+
import { preventSessionStorageSetItemOfPublicKeyByThirdParty } from "./core/iframeMessageProtection.js";
|
|
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/index.js";
|
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/index.js";
|
|
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.js";
|
|
2
|
+
export type { KeycloakIssuerUriParsed } from "./keycloakIssuerUriParsed.js";
|
|
3
|
+
export { type KeycloakUtils, KeycloakProfile, KeycloakUserInfo, createKeycloakUtils } from "./keycloakUtils.js";
|
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.js";
|
|
2
|
+
export { createKeycloakUtils } from "./keycloakUtils.js";
|
|
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.js";
|
|
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.js";
|
|
2
|
+
import { createOidc, OidcInitializationError } from "../../core/index.js";
|
|
3
|
+
import { Deferred } from "../../tools/Deferred.js";
|
|
4
|
+
import { decodeJwt } from "../../tools/decodeJwt.js";
|
|
5
|
+
import { createKeycloakUtils } from "../keycloakUtils.js";
|
|
6
|
+
import { workerTimers } from "../../vendor/frontend/worker-timers.js";
|
|
7
|
+
import { createStatefulEvt } from "../../tools/StatefulEvt.js";
|
|
8
|
+
import { readExpirationTimeInJwt } from "../../tools/readExpirationTimeInJwt.js";
|
|
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.js";
|
|
2
|
+
export { Keycloak } from "./Keycloak.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { Keycloak } from "./Keycloak";
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export { Keycloak } from "./Keycloak.js";
|
|
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.js";
|
|
2
|
+
import { isKeycloak } from "./isKeycloak.js";
|
|
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.js";
|
|
2
|
+
import { parseKeycloakIssuerUri } from "./keycloakIssuerUriParsed.js";
|
|
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/index.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/index.js";
|
|
2
|
+
//# sourceMappingURL=keycloak-js.js.map
|
package/esm/mock/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./oidc";
|
|
1
|
+
export * from "./oidc.js";
|
package/esm/mock/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from "./oidc";
|
|
2
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
export * from "./oidc.js";
|
|
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/index.js";
|
|
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.js";
|
|
2
|
+
import { id } from "../vendor/frontend/tsafe.js";
|
|
3
|
+
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl.js";
|
|
4
|
+
import { getSearchParam, addOrUpdateSearchParam } from "../tools/urlSearchParams.js";
|
|
5
|
+
import { initialLocationHref } from "../core/initialLocationHref.js";
|
|
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.js";
|
|
2
|
+
import type { ValueOrAsyncGetter } from "../tools/ValueOrAsyncGetter.js";
|
|
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("../index.js").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").OidcReact.LoggedIn<DecodedIdToken> : {
|
|
25
|
+
}) => import("../react/react.js").OidcReact.LoggedIn<DecodedIdToken> : {
|
|
26
26
|
(params?: {
|
|
27
27
|
assert?: undefined;
|
|
28
|
-
}): import("../react/react").OidcReact<DecodedIdToken>;
|
|
28
|
+
}): import("../react/react.js").OidcReact<DecodedIdToken>;
|
|
29
29
|
(params: {
|
|
30
30
|
assert: "user logged in";
|
|
31
|
-
}): import("../react/react").OidcReact.LoggedIn<DecodedIdToken>;
|
|
31
|
+
}): import("../react/react.js").OidcReact.LoggedIn<DecodedIdToken>;
|
|
32
32
|
(params: {
|
|
33
33
|
assert: "user not logged in";
|
|
34
|
-
}): import("../react/react").OidcReact.NotLoggedIn;
|
|
34
|
+
}): import("../react/react.js").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("../index.js").Oidc.LoggedIn<DecodedIdToken> : import("../index.js").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.js";
|
|
2
|
+
import { createMockOidc } from "./oidc.js";
|
|
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.js";
|
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.js";
|
|
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/index.js";
|
|
3
|
+
import type { ValueOrAsyncGetter } from "../tools/ValueOrAsyncGetter.js";
|
|
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/index.js";
|
|
4
|
+
import { assert } from "../vendor/frontend/tsafe.js";
|
|
5
|
+
import { id } from "../vendor/frontend/tsafe.js";
|
|
6
|
+
import { Deferred } from "../tools/Deferred.js";
|
|
7
|
+
import { toFullyQualifiedUrl } from "../tools/toFullyQualifiedUrl.js";
|
|
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.js";
|
|
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.js";
|
|
2
|
+
import { assert, is } from "../vendor/frontend/tsafe.js";
|
|
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.js";
|
|
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.js";
|
|
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.js";
|
|
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/index.js";
|
|
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.js";
|
|
2
|
+
import { assert } from "../vendor/frontend/tsafe.js";
|
|
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.js";
|
|
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.js";
|
|
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.js";
|
|
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
|