oidc-spa 7.1.10 → 7.2.0-rc.2
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/backend.js +235 -352
- package/backend.js.map +1 -1
- package/core/AuthResponse.js +12 -49
- package/core/AuthResponse.js.map +1 -1
- package/core/Oidc.d.ts +1 -2
- package/core/Oidc.js.map +1 -1
- package/core/OidcInitializationError.d.ts +0 -13
- package/core/OidcInitializationError.js +8 -318
- package/core/OidcInitializationError.js.map +1 -1
- package/core/OidcMetadata.js +1 -1
- package/core/OidcMetadata.js.map +1 -1
- package/core/StateData.d.ts +5 -5
- package/core/StateData.js +25 -25
- package/core/StateData.js.map +1 -1
- package/core/configId.js +1 -1
- package/core/configId.js.map +1 -1
- package/core/createOidc.d.ts +8 -0
- package/core/createOidc.js +1030 -1292
- package/core/createOidc.js.map +1 -1
- package/core/diagnostic.d.ts +14 -0
- package/core/diagnostic.js +214 -0
- package/core/diagnostic.js.map +1 -0
- package/core/evtIsUserActive.js +26 -27
- package/core/evtIsUserActive.js.map +1 -1
- package/core/handleOidcCallback.js +99 -154
- package/core/handleOidcCallback.js.map +1 -1
- package/core/iframeMessageProtection.d.ts +1 -1
- package/core/iframeMessageProtection.js +40 -106
- package/core/iframeMessageProtection.js.map +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +3 -3
- package/core/index.js.map +1 -1
- package/core/initialLocationHref.js +1 -1
- package/core/initialLocationHref.js.map +1 -1
- package/core/isNewBrowserSession.js +8 -8
- package/core/isNewBrowserSession.js.map +1 -1
- package/core/loginOrGoToAuthServer.d.ts +1 -1
- package/core/loginOrGoToAuthServer.js +188 -310
- package/core/loginOrGoToAuthServer.js.map +1 -1
- package/core/loginPropagationToOtherTabs.js +15 -16
- package/core/loginPropagationToOtherTabs.js.map +1 -1
- package/core/loginSilent.d.ts +2 -3
- package/core/loginSilent.js +118 -214
- package/core/loginSilent.js.map +1 -1
- package/core/logoutPropagationToOtherTabs.js +15 -16
- package/core/logoutPropagationToOtherTabs.js.map +1 -1
- package/core/oidcClientTsUserToTokens.d.ts +1 -1
- package/core/oidcClientTsUserToTokens.js +75 -72
- package/core/oidcClientTsUserToTokens.js.map +1 -1
- package/core/ongoingLoginOrRefreshProcesses.js +23 -89
- package/core/ongoingLoginOrRefreshProcesses.js.map +1 -1
- package/core/persistedAuthState.js +13 -13
- package/core/persistedAuthState.js.map +1 -1
- package/entrypoint.js +9 -9
- package/entrypoint.js.map +1 -1
- package/esm/core/AuthResponse.d.ts +5 -0
- package/{src/core/AuthResponse.ts → esm/core/AuthResponse.js} +3 -9
- package/esm/core/AuthResponse.js.map +1 -0
- package/esm/core/Oidc.d.ts +126 -0
- package/esm/core/Oidc.js +2 -0
- package/esm/core/Oidc.js.map +1 -0
- package/esm/core/OidcInitializationError.d.ts +7 -0
- package/esm/core/OidcInitializationError.js +17 -0
- package/esm/core/OidcInitializationError.js.map +1 -0
- package/{src/core/OidcMetadata.ts → esm/core/OidcMetadata.d.ts} +0 -5
- package/esm/core/OidcMetadata.js +3 -0
- package/esm/core/OidcMetadata.js.map +1 -0
- package/esm/core/StateData.d.ts +42 -0
- package/esm/core/StateData.js +55 -0
- package/esm/core/StateData.js.map +1 -0
- package/esm/core/configId.d.ts +4 -0
- package/esm/core/configId.js +4 -0
- package/esm/core/configId.js.map +1 -0
- package/esm/core/createOidc.d.ts +132 -0
- package/{src/core/createOidc.ts → esm/core/createOidc.js} +282 -826
- package/esm/core/createOidc.js.map +1 -0
- package/esm/core/diagnostic.d.ts +14 -0
- package/{src/core/OidcInitializationError.ts → esm/core/diagnostic.js} +40 -117
- package/esm/core/diagnostic.js.map +1 -0
- package/esm/core/evtIsUserActive.d.ts +5 -0
- package/{src/core/evtIsUserActive.ts → esm/core/evtIsUserActive.js} +14 -46
- package/esm/core/evtIsUserActive.js.map +1 -0
- package/esm/core/handleOidcCallback.d.ts +13 -0
- package/{src/core/handleOidcCallback.ts → esm/core/handleOidcCallback.js} +56 -131
- package/esm/core/handleOidcCallback.js.map +1 -0
- package/esm/core/iframeMessageProtection.d.ts +20 -0
- package/{src/core/iframeMessageProtection.ts → esm/core/iframeMessageProtection.js} +14 -49
- package/esm/core/iframeMessageProtection.js.map +1 -0
- package/{src/core/index.ts → esm/core/index.d.ts} +1 -1
- package/esm/core/index.js +4 -0
- package/esm/core/index.js.map +1 -0
- package/esm/core/initialLocationHref.d.ts +1 -0
- package/{src/core/initialLocationHref.ts → esm/core/initialLocationHref.js} +1 -1
- package/esm/core/initialLocationHref.js.map +1 -0
- package/esm/core/isNewBrowserSession.d.ts +9 -0
- package/{src/core/isNewBrowserSession.ts → esm/core/isNewBrowserSession.js} +3 -15
- package/esm/core/isNewBrowserSession.js.map +1 -0
- package/esm/core/loginOrGoToAuthServer.d.ts +40 -0
- package/{src/core/loginOrGoToAuthServer.ts → esm/core/loginOrGoToAuthServer.js} +60 -168
- package/esm/core/loginOrGoToAuthServer.js.map +1 -0
- package/esm/core/loginPropagationToOtherTabs.d.ts +8 -0
- package/{src/core/loginPropagationToOtherTabs.ts → esm/core/loginPropagationToOtherTabs.js} +7 -25
- package/esm/core/loginPropagationToOtherTabs.js.map +1 -0
- package/esm/core/loginSilent.d.ts +28 -0
- package/esm/core/loginSilent.js +125 -0
- package/esm/core/loginSilent.js.map +1 -0
- package/esm/core/logoutPropagationToOtherTabs.d.ts +10 -0
- package/{src/core/logoutPropagationToOtherTabs.ts → esm/core/logoutPropagationToOtherTabs.js} +8 -28
- package/esm/core/logoutPropagationToOtherTabs.js.map +1 -0
- package/esm/core/oidcClientTsUserToTokens.d.ts +11 -0
- package/esm/core/oidcClientTsUserToTokens.js +155 -0
- package/esm/core/oidcClientTsUserToTokens.js.map +1 -0
- package/esm/core/ongoingLoginOrRefreshProcesses.d.ts +6 -0
- package/{src/core/ongoingLoginOrRefreshProcesses.ts → esm/core/ongoingLoginOrRefreshProcesses.js} +6 -24
- package/esm/core/ongoingLoginOrRefreshProcesses.js.map +1 -0
- package/esm/core/persistedAuthState.d.ts +28 -0
- package/esm/core/persistedAuthState.js +64 -0
- package/esm/core/persistedAuthState.js.map +1 -0
- package/esm/entrypoint.d.ts +7 -0
- package/{src/entrypoint.ts → esm/entrypoint.js} +3 -26
- package/esm/entrypoint.js.map +1 -0
- package/esm/index.d.ts +1 -0
- package/esm/index.js +2 -0
- package/esm/index.js.map +1 -0
- package/esm/keycloak/index.d.ts +3 -0
- package/esm/keycloak/index.js +3 -0
- package/esm/keycloak/index.js.map +1 -0
- package/esm/keycloak/isKeycloak.d.ts +3 -0
- package/esm/keycloak/isKeycloak.js +17 -0
- package/esm/keycloak/isKeycloak.js.map +1 -0
- package/esm/keycloak/keycloak-js/Keycloak.d.ts +284 -0
- package/esm/keycloak/keycloak-js/Keycloak.js +774 -0
- package/esm/keycloak/keycloak-js/Keycloak.js.map +1 -0
- package/esm/keycloak/keycloak-js/index.d.ts +2 -0
- package/esm/keycloak/keycloak-js/index.js +2 -0
- package/esm/keycloak/keycloak-js/index.js.map +1 -0
- package/esm/keycloak/keycloak-js/types.d.ts +361 -0
- package/esm/keycloak/keycloak-js/types.js +2 -0
- package/esm/keycloak/keycloak-js/types.js.map +1 -0
- package/esm/keycloak/keycloakIssuerUriParsed.d.ts +9 -0
- package/esm/keycloak/keycloakIssuerUriParsed.js +16 -0
- package/esm/keycloak/keycloakIssuerUriParsed.js.map +1 -0
- package/esm/keycloak/keycloakUtils.d.ts +37 -0
- package/esm/keycloak/keycloakUtils.js +44 -0
- package/esm/keycloak/keycloakUtils.js.map +1 -0
- package/esm/keycloak-js.d.ts +1 -0
- package/esm/keycloak-js.js +2 -0
- package/esm/keycloak-js.js.map +1 -0
- package/esm/mock/index.js +2 -0
- package/esm/mock/index.js.map +1 -0
- package/esm/mock/oidc.d.ts +19 -0
- package/{src/mock/oidc.ts → esm/mock/oidc.js} +28 -88
- package/esm/mock/oidc.js.map +1 -0
- package/esm/mock/react.d.ts +58 -0
- package/esm/mock/react.js +7 -0
- package/esm/mock/react.js.map +1 -0
- package/esm/react/index.js +2 -0
- package/esm/react/index.js.map +1 -0
- package/esm/react/react.d.ts +102 -0
- package/esm/react/react.js +221 -0
- package/esm/react/react.js.map +1 -0
- package/esm/tools/Deferred.d.ts +14 -0
- package/esm/tools/Deferred.js +23 -0
- package/esm/tools/Deferred.js.map +1 -0
- package/esm/tools/EphemeralSessionStorage.d.ts +12 -0
- package/{src/tools/EphemeralSessionStorage.ts → esm/tools/EphemeralSessionStorage.js} +30 -112
- package/esm/tools/EphemeralSessionStorage.js.map +1 -0
- package/esm/tools/Evt.d.ts +11 -0
- package/{src/tools/Evt.ts → esm/tools/Evt.js} +7 -25
- package/esm/tools/Evt.js.map +1 -0
- package/esm/tools/StatefulEvt.d.ts +12 -0
- package/esm/tools/StatefulEvt.js +21 -0
- package/esm/tools/StatefulEvt.js.map +1 -0
- package/esm/tools/ValueOrAsyncGetter.js +2 -0
- package/esm/tools/ValueOrAsyncGetter.js.map +1 -0
- package/esm/tools/asymmetricEncryption.d.ts +18 -0
- package/esm/tools/asymmetricEncryption.js +85 -0
- package/esm/tools/asymmetricEncryption.js.map +1 -0
- package/esm/tools/base64.d.ts +2 -0
- package/{src/tools/base64.ts → esm/tools/base64.js} +3 -3
- package/esm/tools/base64.js.map +1 -0
- package/esm/tools/createObjectThatThrowsIfAccessed.d.ts +8 -0
- package/{src/tools/createObjectThatThrowsIfAccessed.ts → esm/tools/createObjectThatThrowsIfAccessed.js} +7 -18
- package/esm/tools/createObjectThatThrowsIfAccessed.js.map +1 -0
- package/esm/tools/decodeJwt.d.ts +25 -0
- package/esm/tools/decodeJwt.js +60 -0
- package/esm/tools/decodeJwt.js.map +1 -0
- package/esm/tools/generateUrlSafeRandom.d.ts +3 -0
- package/{src/tools/generateUrlSafeRandom.ts → esm/tools/generateUrlSafeRandom.js} +5 -8
- package/esm/tools/generateUrlSafeRandom.js.map +1 -0
- package/esm/tools/getDownlinkAndRtt.d.ts +4 -0
- package/{src/tools/getDownlinkAndRtt.ts → esm/tools/getDownlinkAndRtt.js} +6 -10
- package/esm/tools/getDownlinkAndRtt.js.map +1 -0
- package/esm/tools/getIsOnline.d.ts +7 -0
- package/{src/tools/getIsOnline.ts → esm/tools/getIsOnline.js} +3 -9
- package/esm/tools/getIsOnline.js.map +1 -0
- package/esm/tools/getIsValidRemoteJson.d.ts +1 -0
- package/esm/tools/getIsValidRemoteJson.js +15 -0
- package/esm/tools/getIsValidRemoteJson.js.map +1 -0
- package/esm/tools/getPrUserInteraction.d.ts +4 -0
- package/{src/tools/getPrUserInteraction.ts → esm/tools/getPrUserInteraction.js} +2 -6
- package/esm/tools/getPrUserInteraction.js.map +1 -0
- package/esm/tools/getUserEnvironmentInfo.d.ts +1 -0
- package/esm/tools/getUserEnvironmentInfo.js +50 -0
- package/esm/tools/getUserEnvironmentInfo.js.map +1 -0
- package/esm/tools/haveSharedParentDomain.d.ts +4 -0
- package/{src/tools/haveSharedParentDomain.ts → esm/tools/haveSharedParentDomain.js} +3 -5
- package/esm/tools/haveSharedParentDomain.js.map +1 -0
- package/esm/tools/isDev.d.ts +1 -0
- package/{src/tools/isDev.ts → esm/tools/isDev.js} +5 -12
- package/esm/tools/isDev.js.map +1 -0
- package/esm/tools/parseKeycloakIssuerUri.d.ts +30 -0
- package/esm/tools/parseKeycloakIssuerUri.js +33 -0
- package/esm/tools/parseKeycloakIssuerUri.js.map +1 -0
- package/esm/tools/readExpirationTimeInJwt.d.ts +1 -0
- package/{src/tools/readExpirationTimeInJwt.ts → esm/tools/readExpirationTimeInJwt.js} +6 -7
- package/esm/tools/readExpirationTimeInJwt.js.map +1 -0
- package/esm/tools/startCountdown.d.ts +11 -0
- package/{src/tools/startCountdown.ts → esm/tools/startCountdown.js} +6 -17
- package/esm/tools/startCountdown.js.map +1 -0
- package/esm/tools/subscribeToUserInteraction.d.ts +6 -0
- package/{src/tools/subscribeToUserInteraction.ts → esm/tools/subscribeToUserInteraction.js} +4 -13
- package/esm/tools/subscribeToUserInteraction.js.map +1 -0
- package/esm/tools/toFullyQualifiedUrl.d.ts +10 -0
- package/{src/tools/toFullyQualifiedUrl.ts → esm/tools/toFullyQualifiedUrl.js} +7 -25
- package/esm/tools/toFullyQualifiedUrl.js.map +1 -0
- package/esm/tools/toHumanReadableDuration.d.ts +1 -0
- package/{src/tools/toHumanReadableDuration.ts → esm/tools/toHumanReadableDuration.js} +8 -5
- package/esm/tools/toHumanReadableDuration.js.map +1 -0
- package/esm/tools/urlSearchParams.d.ts +19 -0
- package/{src/tools/urlSearchParams.ts → esm/tools/urlSearchParams.js} +24 -70
- package/esm/tools/urlSearchParams.js.map +1 -0
- package/esm/tools/workerTimers.d.ts +5 -0
- package/{src/tools/workerTimers.ts → esm/tools/workerTimers.js} +7 -27
- package/esm/tools/workerTimers.js.map +1 -0
- package/esm/vendor/frontend/oidc-client-ts.d.ts +1 -0
- package/esm/vendor/frontend/oidc-client-ts.js +3636 -0
- package/{src/vendor/frontend/tsafe.ts → esm/vendor/frontend/tsafe.d.ts} +1 -0
- package/esm/vendor/frontend/tsafe.js +1 -0
- package/esm/vendor/frontend/worker-timers.js +1 -0
- package/index.d.ts +1 -1
- package/index.js +1 -2
- package/index.js.map +1 -1
- package/keycloak/index.d.ts +3 -0
- package/keycloak/index.js +8 -0
- package/keycloak/index.js.map +1 -0
- package/keycloak/isKeycloak.d.ts +3 -0
- package/keycloak/isKeycloak.js +20 -0
- package/keycloak/isKeycloak.js.map +1 -0
- package/keycloak/keycloak-js/Keycloak.d.ts +284 -0
- package/keycloak/keycloak-js/Keycloak.js +778 -0
- package/keycloak/keycloak-js/Keycloak.js.map +1 -0
- package/keycloak/keycloak-js/index.d.ts +2 -0
- package/keycloak/keycloak-js/index.js +6 -0
- package/keycloak/keycloak-js/index.js.map +1 -0
- package/keycloak/keycloak-js/types.d.ts +361 -0
- package/keycloak/keycloak-js/types.js +3 -0
- package/keycloak/keycloak-js/types.js.map +1 -0
- package/keycloak/keycloakIssuerUriParsed.d.ts +9 -0
- package/keycloak/keycloakIssuerUriParsed.js +19 -0
- package/keycloak/keycloakIssuerUriParsed.js.map +1 -0
- package/keycloak/keycloakUtils.d.ts +37 -0
- package/keycloak/keycloakUtils.js +47 -0
- package/keycloak/keycloakUtils.js.map +1 -0
- package/keycloak-js.d.ts +1 -0
- package/keycloak-js.js +18 -0
- package/keycloak-js.js.map +1 -0
- package/mock/index.js.map +1 -1
- package/mock/oidc.js +147 -194
- package/mock/oidc.js.map +1 -1
- package/mock/react.js +2 -2
- package/mock/react.js.map +1 -1
- package/package.json +74 -299
- package/react/index.js.map +1 -1
- package/react/react.js +133 -244
- package/react/react.js.map +1 -1
- package/tools/Deferred.js +13 -35
- package/tools/Deferred.js.map +1 -1
- package/tools/EphemeralSessionStorage.js +46 -48
- package/tools/EphemeralSessionStorage.js.map +1 -1
- package/tools/Evt.js +14 -14
- package/tools/Evt.js.map +1 -1
- package/tools/StatefulEvt.js +5 -5
- package/tools/StatefulEvt.js.map +1 -1
- package/tools/ValueOrAsyncGetter.js.map +1 -1
- package/tools/asymmetricEncryption.js +81 -172
- package/tools/asymmetricEncryption.js.map +1 -1
- package/tools/base64.js +2 -2
- package/tools/base64.js.map +1 -1
- package/tools/createObjectThatThrowsIfAccessed.js +13 -61
- package/tools/createObjectThatThrowsIfAccessed.js.map +1 -1
- package/tools/decodeJwt.d.ts +25 -2
- package/tools/decodeJwt.js +61 -3
- package/tools/decodeJwt.js.map +1 -1
- package/tools/generateUrlSafeRandom.js +5 -30
- package/tools/generateUrlSafeRandom.js.map +1 -1
- package/tools/getDownlinkAndRtt.js +8 -30
- package/tools/getDownlinkAndRtt.js.map +1 -1
- package/tools/getIsOnline.js +3 -3
- package/tools/getIsOnline.js.map +1 -1
- package/tools/getIsValidRemoteJson.js +12 -59
- package/tools/getIsValidRemoteJson.js.map +1 -1
- package/tools/getPrUserInteraction.js +4 -4
- package/tools/getPrUserInteraction.js.map +1 -1
- package/tools/getUserEnvironmentInfo.js +17 -12
- package/tools/getUserEnvironmentInfo.js.map +1 -1
- package/tools/haveSharedParentDomain.js +5 -5
- package/tools/haveSharedParentDomain.js.map +1 -1
- package/tools/isDev.js +2 -2
- package/tools/isDev.js.map +1 -1
- package/tools/parseKeycloakIssuerUri.d.ts +2 -0
- package/tools/parseKeycloakIssuerUri.js +11 -42
- package/tools/parseKeycloakIssuerUri.js.map +1 -1
- package/tools/readExpirationTimeInJwt.js +4 -4
- package/tools/readExpirationTimeInJwt.js.map +1 -1
- package/tools/startCountdown.js +17 -65
- package/tools/startCountdown.js.map +1 -1
- package/tools/subscribeToUserInteraction.js +17 -66
- package/tools/subscribeToUserInteraction.js.map +1 -1
- package/tools/toFullyQualifiedUrl.js +7 -7
- package/tools/toFullyQualifiedUrl.js.map +1 -1
- package/tools/toHumanReadableDuration.js +13 -13
- package/tools/toHumanReadableDuration.js.map +1 -1
- package/tools/urlSearchParams.js +28 -50
- package/tools/urlSearchParams.js.map +1 -1
- package/tools/workerTimers.js +10 -10
- package/tools/workerTimers.js.map +1 -1
- package/vendor/frontend/oidc-client-ts.d.ts +1 -0
- package/vendor/frontend/oidc-client-ts.js +3686 -0
- package/vendor/frontend/tsafe.d.ts +1 -0
- package/vendor/frontend/tsafe.js +1 -1
- package/LICENSE +0 -21
- package/README.md +0 -185
- package/core/trustedFetch.d.ts +0 -2
- package/core/trustedFetch.js +0 -12
- package/core/trustedFetch.js.map +0 -1
- package/src/backend.ts +0 -391
- package/src/core/Oidc.ts +0 -141
- package/src/core/StateData.ts +0 -118
- package/src/core/configId.ts +0 -3
- package/src/core/loginSilent.ts +0 -206
- package/src/core/oidcClientTsUserToTokens.ts +0 -229
- package/src/core/persistedAuthState.ts +0 -122
- package/src/core/trustedFetch.ts +0 -9
- package/src/index.ts +0 -7
- package/src/mock/react.tsx +0 -11
- package/src/react/react.tsx +0 -460
- package/src/tools/Deferred.ts +0 -39
- package/src/tools/StatefulEvt.ts +0 -38
- package/src/tools/asymmetricEncryption.ts +0 -184
- package/src/tools/decodeJwt.ts +0 -2
- package/src/tools/getIsValidRemoteJson.ts +0 -18
- package/src/tools/getUserEnvironmentInfo.ts +0 -42
- package/src/tools/parseKeycloakIssuerUri.ts +0 -68
- package/src/vendor/backend/evt.ts +0 -2
- package/src/vendor/backend/jsonwebtoken.ts +0 -1
- package/src/vendor/backend/node-fetch.ts +0 -2
- package/src/vendor/backend/node-jose.ts +0 -1
- package/src/vendor/backend/tsafe.ts +0 -5
- package/src/vendor/backend/zod.ts +0 -1
- package/src/vendor/frontend/oidc-client-ts-and-jwt-decode.ts +0 -4
- package/vendor/frontend/oidc-client-ts-and-jwt-decode.d.ts +0 -3
- package/vendor/frontend/oidc-client-ts-and-jwt-decode.js +0 -3
- /package/{src/mock/index.ts → esm/mock/index.d.ts} +0 -0
- /package/{src/react/index.ts → esm/react/index.d.ts} +0 -0
- /package/{src/tools/ValueOrAsyncGetter.ts → esm/tools/ValueOrAsyncGetter.d.ts} +0 -0
- /package/{src/vendor/frontend/worker-timers.ts → esm/vendor/frontend/worker-timers.d.ts} +0 -0
package/core/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/core/index.ts"],"names":[],"mappings":";;;AACA,2CAAmE;AAA1D,wGAAA,UAAU,OAAA;AACnB,qEAAoE;AAA3D,kIAAA,uBAAuB,OAAA;AAChC,2DAA0D;AAAjD,wHAAA,kBAAkB,OAAA"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.initialLocationHref = void 0;
|
|
4
|
-
|
|
4
|
+
const globalContext = {
|
|
5
5
|
initialLocationHref: window.location.href
|
|
6
6
|
};
|
|
7
7
|
exports.initialLocationHref = globalContext.initialLocationHref;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"initialLocationHref.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"initialLocationHref.js","sourceRoot":"","sources":["../../src/core/initialLocationHref.ts"],"names":[],"mappings":";;;AAAA,MAAM,aAAa,GAAG;IAClB,mBAAmB,EAAE,MAAM,CAAC,QAAQ,CAAC,IAAI;CAC5C,CAAC;AAEa,2BAAmB,GAAK,aAAa,qBAAC"}
|
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.createGetIsNewBrowserSession = createGetIsNewBrowserSession;
|
|
4
4
|
function createGetIsNewBrowserSession(params) {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
const { configId, evtUserNotLoggedIn } = params;
|
|
6
|
+
const SESSION_STORAGE_KEY = `oidc-spa.subject-id:${configId}`;
|
|
7
7
|
{
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
const { unsubscribe } = evtUserNotLoggedIn.subscribe(() => {
|
|
9
|
+
unsubscribe();
|
|
10
10
|
sessionStorage.removeItem(SESSION_STORAGE_KEY);
|
|
11
|
-
})
|
|
11
|
+
});
|
|
12
12
|
}
|
|
13
13
|
function getIsNewBrowserSession(params) {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
const { subjectId } = params;
|
|
15
|
+
const subjectId_sessionStorage = sessionStorage.getItem(SESSION_STORAGE_KEY);
|
|
16
16
|
if (subjectId_sessionStorage === null) {
|
|
17
17
|
sessionStorage.setItem(SESSION_STORAGE_KEY, subjectId);
|
|
18
18
|
return true;
|
|
@@ -23,6 +23,6 @@ function createGetIsNewBrowserSession(params) {
|
|
|
23
23
|
}
|
|
24
24
|
return false;
|
|
25
25
|
}
|
|
26
|
-
return { getIsNewBrowserSession
|
|
26
|
+
return { getIsNewBrowserSession };
|
|
27
27
|
}
|
|
28
28
|
//# sourceMappingURL=isNewBrowserSession.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"isNewBrowserSession.js","sourceRoot":"","sources":["
|
|
1
|
+
{"version":3,"file":"isNewBrowserSession.js","sourceRoot":"","sources":["../../src/core/isNewBrowserSession.ts"],"names":[],"mappings":";;AAEA,oEAkCC;AAlCD,SAAgB,4BAA4B,CAAC,MAG5C;IACG,MAAM,EAAE,QAAQ,EAAE,kBAAkB,EAAE,GAAG,MAAM,CAAC;IAEhD,MAAM,mBAAmB,GAAG,uBAAuB,QAAQ,EAAE,CAAC;IAE9D,CAAC;QACG,MAAM,EAAE,WAAW,EAAE,GAAG,kBAAkB,CAAC,SAAS,CAAC,GAAG,EAAE;YACtD,WAAW,EAAE,CAAC;YACd,cAAc,CAAC,UAAU,CAAC,mBAAmB,CAAC,CAAC;QACnD,CAAC,CAAC,CAAC;IACP,CAAC;IAED,SAAS,sBAAsB,CAAC,MAA6B;QACzD,MAAM,EAAE,SAAS,EAAE,GAAG,MAAM,CAAC;QAE7B,MAAM,wBAAwB,GAAG,cAAc,CAAC,OAAO,CAAC,mBAAmB,CAAC,CAAC;QAE7E,IAAI,wBAAwB,KAAK,IAAI,EAAE,CAAC;YACpC,cAAc,CAAC,OAAO,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;YACvD,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,IAAI,SAAS,KAAK,wBAAwB,EAAE,CAAC;YACzC,cAAc,CAAC,OAAO,CAAC,mBAAmB,EAAE,SAAS,CAAC,CAAC;YACvD,OAAO,IAAI,CAAC;QAChB,CAAC;QAED,OAAO,KAAK,CAAC;IACjB,CAAC;IAED,OAAO,EAAE,sBAAsB,EAAE,CAAC;AACtC,CAAC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { UserManager as OidcClientTsUserManager } from "../vendor/frontend/oidc-client-ts
|
|
1
|
+
import type { UserManager as OidcClientTsUserManager } from "../vendor/frontend/oidc-client-ts";
|
|
2
2
|
import type { NonPostableEvt } from "../tools/Evt";
|
|
3
3
|
type Params = Params.Login | Params.GoToAuthServer;
|
|
4
4
|
declare namespace Params {
|
|
@@ -1,342 +1,220 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
13
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
-
function step(op) {
|
|
16
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
18
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
19
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
-
switch (op[0]) {
|
|
21
|
-
case 0: case 1: t = op; break;
|
|
22
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
-
default:
|
|
26
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
-
if (t[2]) _.ops.pop();
|
|
31
|
-
_.trys.pop(); continue;
|
|
32
|
-
}
|
|
33
|
-
op = body.call(thisArg, _);
|
|
34
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
-
}
|
|
37
|
-
};
|
|
38
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
39
|
-
var t = {};
|
|
40
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
41
|
-
t[p] = s[p];
|
|
42
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
43
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
44
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
45
|
-
t[p[i]] = s[p[i]];
|
|
46
|
-
}
|
|
47
|
-
return t;
|
|
48
|
-
};
|
|
49
|
-
var __read = (this && this.__read) || function (o, n) {
|
|
50
|
-
var m = typeof Symbol === "function" && o[Symbol.iterator];
|
|
51
|
-
if (!m) return o;
|
|
52
|
-
var i = m.call(o), r, ar = [], e;
|
|
53
|
-
try {
|
|
54
|
-
while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);
|
|
55
|
-
}
|
|
56
|
-
catch (error) { e = { error: error }; }
|
|
57
|
-
finally {
|
|
58
|
-
try {
|
|
59
|
-
if (r && !r.done && (m = i["return"])) m.call(i);
|
|
60
|
-
}
|
|
61
|
-
finally { if (e) throw e.error; }
|
|
62
|
-
}
|
|
63
|
-
return ar;
|
|
64
|
-
};
|
|
65
|
-
var __values = (this && this.__values) || function(o) {
|
|
66
|
-
var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
|
|
67
|
-
if (m) return m.call(o);
|
|
68
|
-
if (o && typeof o.length === "number") return {
|
|
69
|
-
next: function () {
|
|
70
|
-
if (o && i >= o.length) o = void 0;
|
|
71
|
-
return { value: o && o[i++], done: !o };
|
|
72
|
-
}
|
|
73
|
-
};
|
|
74
|
-
throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
|
|
75
|
-
};
|
|
76
|
-
var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
77
|
-
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
78
|
-
if (ar || !(i in from)) {
|
|
79
|
-
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
80
|
-
ar[i] = from[i];
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return to.concat(ar || Array.prototype.slice.call(from));
|
|
84
|
-
};
|
|
85
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
86
3
|
exports.getPrSafelyRestoredFromBfCacheAfterLoginBackNavigation = getPrSafelyRestoredFromBfCacheAfterLoginBackNavigation;
|
|
87
4
|
exports.createLoginOrGoToAuthServer = createLoginOrGoToAuthServer;
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
evtHasLoginBeenCalled: (0, StatefulEvt_1.createStatefulEvt)(
|
|
5
|
+
const toFullyQualifiedUrl_1 = require("../tools/toFullyQualifiedUrl");
|
|
6
|
+
const tsafe_1 = require("../vendor/frontend/tsafe");
|
|
7
|
+
const StatefulEvt_1 = require("../tools/StatefulEvt");
|
|
8
|
+
const Deferred_1 = require("../tools/Deferred");
|
|
9
|
+
const urlSearchParams_1 = require("../tools/urlSearchParams");
|
|
10
|
+
const globalContext = {
|
|
11
|
+
evtHasLoginBeenCalled: (0, StatefulEvt_1.createStatefulEvt)(() => false)
|
|
95
12
|
};
|
|
96
13
|
function getPrSafelyRestoredFromBfCacheAfterLoginBackNavigation() {
|
|
97
|
-
|
|
98
|
-
|
|
14
|
+
const dOut = new Deferred_1.Deferred();
|
|
15
|
+
const { unsubscribe } = globalContext.evtHasLoginBeenCalled.subscribe(hasLoginBeenCalled => {
|
|
99
16
|
if (!hasLoginBeenCalled) {
|
|
100
17
|
unsubscribe();
|
|
101
18
|
dOut.resolve();
|
|
102
19
|
}
|
|
103
|
-
})
|
|
20
|
+
});
|
|
104
21
|
return dOut.pr;
|
|
105
22
|
}
|
|
106
23
|
function createLoginOrGoToAuthServer(params) {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
function loginOrGoToAuthServer(params) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
24
|
+
const { configId, oidcClientTsUserManager, transformUrlBeforeRedirect, getExtraQueryParams, getExtraTokenParams, homeUrl, evtIsUserLoggedIn, log } = params;
|
|
25
|
+
const LOCAL_STORAGE_KEY_TO_CLEAR_WHEN_USER_LOGGED_IN = `oidc-spa.login-redirect-initiated:${configId}`;
|
|
26
|
+
let lastPublicUrl = undefined;
|
|
27
|
+
async function loginOrGoToAuthServer(params) {
|
|
28
|
+
const { redirectUrl: redirectUrl_params, extraQueryParams_local, transformUrlBeforeRedirect_local, ...rest } = params;
|
|
29
|
+
log?.(`Calling loginOrGoToAuthServer ${JSON.stringify(params, null, 2)}`);
|
|
30
|
+
login_specific_handling: {
|
|
31
|
+
if (rest.action !== "login") {
|
|
32
|
+
break login_specific_handling;
|
|
33
|
+
}
|
|
34
|
+
if (globalContext.evtHasLoginBeenCalled.current) {
|
|
35
|
+
log?.("login() has already been called, ignoring the call");
|
|
36
|
+
return new Promise(() => { });
|
|
37
|
+
}
|
|
38
|
+
globalContext.evtHasLoginBeenCalled.current = true;
|
|
39
|
+
if (document.visibilityState !== "visible") {
|
|
40
|
+
rest.interaction === "ensure no interaction";
|
|
41
|
+
const dVisible = new Deferred_1.Deferred();
|
|
42
|
+
const onVisible = () => {
|
|
43
|
+
if (document.visibilityState !== "visible") {
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
document.removeEventListener("visibilitychange", onVisible);
|
|
47
|
+
dVisible.resolve();
|
|
48
|
+
};
|
|
49
|
+
document.addEventListener("visibilitychange", onVisible);
|
|
50
|
+
await dVisible.pr;
|
|
51
|
+
}
|
|
52
|
+
bf_cache_handling: {
|
|
53
|
+
if (rest.doForceReloadOnBfCache) {
|
|
54
|
+
window.removeEventListener("pageshow", () => {
|
|
55
|
+
location.reload();
|
|
56
|
+
});
|
|
57
|
+
break bf_cache_handling;
|
|
58
|
+
}
|
|
59
|
+
localStorage.setItem(LOCAL_STORAGE_KEY_TO_CLEAR_WHEN_USER_LOGGED_IN, "true");
|
|
60
|
+
const callback = () => {
|
|
61
|
+
window.removeEventListener("pageshow", callback);
|
|
62
|
+
log?.("We came back from the login pages and the state of the app has been restored");
|
|
63
|
+
if (rest.doNavigateBackToLastPublicUrlIfTheTheUserNavigateBack) {
|
|
64
|
+
if (lastPublicUrl !== undefined) {
|
|
65
|
+
log?.(`Loading last public route: ${lastPublicUrl}`);
|
|
66
|
+
window.location.href = lastPublicUrl;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
log?.("We don't know the last public route, navigating back in history");
|
|
70
|
+
window.history.back();
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
log?.("The current page doesn't require auth...");
|
|
75
|
+
if (localStorage.getItem(LOCAL_STORAGE_KEY_TO_CLEAR_WHEN_USER_LOGGED_IN) === null) {
|
|
76
|
+
log?.("but the user is now authenticated, reloading the page");
|
|
77
|
+
location.reload();
|
|
120
78
|
}
|
|
121
|
-
|
|
122
|
-
log
|
|
123
|
-
|
|
79
|
+
else {
|
|
80
|
+
log?.("and the user doesn't seem to be authenticated, avoiding a reload");
|
|
81
|
+
globalContext.evtHasLoginBeenCalled.current = false;
|
|
124
82
|
}
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
window.addEventListener("pageshow", callback);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
const redirectUrl = (0, toFullyQualifiedUrl_1.toFullyQualifiedUrl)({
|
|
89
|
+
urlish: redirectUrl_params,
|
|
90
|
+
doAssertNoQueryParams: false
|
|
91
|
+
});
|
|
92
|
+
log?.(`redirectUrl: ${redirectUrl}`);
|
|
93
|
+
const stateData = {
|
|
94
|
+
context: "redirect",
|
|
95
|
+
redirectUrl,
|
|
96
|
+
extraQueryParams: {},
|
|
97
|
+
hasBeenProcessedByCallback: false,
|
|
98
|
+
configId,
|
|
99
|
+
action: "login",
|
|
100
|
+
redirectUrl_consentRequiredCase: (() => {
|
|
101
|
+
switch (rest.action) {
|
|
102
|
+
case "login":
|
|
103
|
+
return lastPublicUrl ?? homeUrl;
|
|
104
|
+
case "go to auth server":
|
|
105
|
+
return redirectUrl;
|
|
106
|
+
}
|
|
107
|
+
})()
|
|
108
|
+
};
|
|
109
|
+
const isSilent = rest.action === "login" && rest.interaction === "ensure no interaction";
|
|
110
|
+
const transformUrl_oidcClientTs = (url) => {
|
|
111
|
+
[
|
|
112
|
+
[
|
|
113
|
+
getExtraQueryParams,
|
|
114
|
+
transformUrlBeforeRedirect === undefined
|
|
115
|
+
? undefined
|
|
116
|
+
: (url) => transformUrlBeforeRedirect({
|
|
117
|
+
isSilent,
|
|
118
|
+
authorizationUrl: url
|
|
119
|
+
})
|
|
120
|
+
],
|
|
121
|
+
[extraQueryParams_local, transformUrlBeforeRedirect_local]
|
|
122
|
+
].forEach(([extraQueryParamsMaybeGetter, transformUrlBeforeRedirect], i, arr) => {
|
|
123
|
+
const url_before = i !== arr.length - 1 ? undefined : url;
|
|
124
|
+
add_extra_query_params: {
|
|
125
|
+
if (extraQueryParamsMaybeGetter === undefined) {
|
|
126
|
+
break add_extra_query_params;
|
|
127
|
+
}
|
|
128
|
+
const extraQueryParams = typeof extraQueryParamsMaybeGetter === "function"
|
|
129
|
+
? extraQueryParamsMaybeGetter({ isSilent, url })
|
|
130
|
+
: extraQueryParamsMaybeGetter;
|
|
131
|
+
for (const [name, value] of Object.entries(extraQueryParams)) {
|
|
132
|
+
if (value === undefined) {
|
|
133
|
+
continue;
|
|
176
134
|
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
135
|
+
url = (0, urlSearchParams_1.addOrUpdateSearchParam)({
|
|
136
|
+
url,
|
|
137
|
+
name,
|
|
138
|
+
value,
|
|
139
|
+
encodeMethod: "www-form"
|
|
182
140
|
});
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
getExtraQueryParams,
|
|
205
|
-
transformUrlBeforeRedirect === undefined
|
|
206
|
-
? undefined
|
|
207
|
-
: function (url) {
|
|
208
|
-
return transformUrlBeforeRedirect({
|
|
209
|
-
isSilent: isSilent,
|
|
210
|
-
authorizationUrl: url
|
|
211
|
-
});
|
|
212
|
-
}
|
|
213
|
-
],
|
|
214
|
-
[extraQueryParams_local, transformUrlBeforeRedirect_local]
|
|
215
|
-
].forEach(function (_a, i, arr) {
|
|
216
|
-
var e_1, _b, e_2, _c;
|
|
217
|
-
var _d = __read(_a, 2), extraQueryParamsMaybeGetter = _d[0], transformUrlBeforeRedirect = _d[1];
|
|
218
|
-
var url_before = i !== arr.length - 1 ? undefined : url;
|
|
219
|
-
add_extra_query_params: {
|
|
220
|
-
if (extraQueryParamsMaybeGetter === undefined) {
|
|
221
|
-
break add_extra_query_params;
|
|
222
|
-
}
|
|
223
|
-
var extraQueryParams = typeof extraQueryParamsMaybeGetter === "function"
|
|
224
|
-
? extraQueryParamsMaybeGetter({ isSilent: isSilent, url: url })
|
|
225
|
-
: extraQueryParamsMaybeGetter;
|
|
226
|
-
try {
|
|
227
|
-
for (var _e = __values(Object.entries(extraQueryParams)), _f = _e.next(); !_f.done; _f = _e.next()) {
|
|
228
|
-
var _g = __read(_f.value, 2), name_1 = _g[0], value = _g[1];
|
|
229
|
-
if (value === undefined) {
|
|
230
|
-
continue;
|
|
231
|
-
}
|
|
232
|
-
url = (0, urlSearchParams_1.addOrUpdateSearchParam)({
|
|
233
|
-
url: url,
|
|
234
|
-
name: name_1,
|
|
235
|
-
value: value,
|
|
236
|
-
encodeMethod: "www-form"
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
}
|
|
240
|
-
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
241
|
-
finally {
|
|
242
|
-
try {
|
|
243
|
-
if (_f && !_f.done && (_b = _e.return)) _b.call(_e);
|
|
244
|
-
}
|
|
245
|
-
finally { if (e_1) throw e_1.error; }
|
|
246
|
-
}
|
|
247
|
-
}
|
|
248
|
-
apply_transform_url: {
|
|
249
|
-
if (transformUrlBeforeRedirect === undefined) {
|
|
250
|
-
break apply_transform_url;
|
|
251
|
-
}
|
|
252
|
-
url = transformUrlBeforeRedirect(url);
|
|
253
|
-
}
|
|
254
|
-
update_state: {
|
|
255
|
-
if (url_before === undefined) {
|
|
256
|
-
break update_state;
|
|
257
|
-
}
|
|
258
|
-
var paramValueByName_current = (0, urlSearchParams_1.getAllSearchParams)(url);
|
|
259
|
-
var paramValueByName_before = (0, urlSearchParams_1.getAllSearchParams)(url_before);
|
|
260
|
-
try {
|
|
261
|
-
for (var _h = __values(Object.entries(paramValueByName_current)), _j = _h.next(); !_j.done; _j = _h.next()) {
|
|
262
|
-
var _k = __read(_j.value, 2), name_2 = _k[0], value_current = _k[1];
|
|
263
|
-
var value_before = paramValueByName_before[name_2];
|
|
264
|
-
if (value_before === value_current) {
|
|
265
|
-
continue;
|
|
266
|
-
}
|
|
267
|
-
stateData.extraQueryParams[name_2] = value_current;
|
|
268
|
-
}
|
|
269
|
-
}
|
|
270
|
-
catch (e_2_1) { e_2 = { error: e_2_1 }; }
|
|
271
|
-
finally {
|
|
272
|
-
try {
|
|
273
|
-
if (_j && !_j.done && (_c = _h.return)) _c.call(_h);
|
|
274
|
-
}
|
|
275
|
-
finally { if (e_2) throw e_2.error; }
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
});
|
|
279
|
-
return url;
|
|
280
|
-
};
|
|
281
|
-
redirectMethod = (function () {
|
|
282
|
-
switch (rest.action) {
|
|
283
|
-
case "login":
|
|
284
|
-
return rest.doNavigateBackToLastPublicUrlIfTheTheUserNavigateBack
|
|
285
|
-
? "replace"
|
|
286
|
-
: "assign";
|
|
287
|
-
case "go to auth server":
|
|
288
|
-
return "assign";
|
|
289
|
-
}
|
|
290
|
-
})();
|
|
291
|
-
log === null || log === void 0 ? void 0 : log("redirectMethod: ".concat(redirectMethod));
|
|
292
|
-
return [2 /*return*/, oidcClientTsUserManager
|
|
293
|
-
.signinRedirect({
|
|
294
|
-
state: stateData,
|
|
295
|
-
redirectMethod: redirectMethod,
|
|
296
|
-
prompt: (function () {
|
|
297
|
-
switch (rest.action) {
|
|
298
|
-
case "go to auth server":
|
|
299
|
-
return undefined;
|
|
300
|
-
case "login":
|
|
301
|
-
switch (rest.interaction) {
|
|
302
|
-
case "ensure no interaction":
|
|
303
|
-
return "none";
|
|
304
|
-
case "ensure interaction":
|
|
305
|
-
return "login";
|
|
306
|
-
case "directly redirect if active session show login otherwise":
|
|
307
|
-
return undefined;
|
|
308
|
-
}
|
|
309
|
-
tsafe_1.assert;
|
|
310
|
-
}
|
|
311
|
-
tsafe_1.assert;
|
|
312
|
-
})(),
|
|
313
|
-
transformUrl: transformUrl_oidcClientTs,
|
|
314
|
-
extraTokenParams: getExtraTokenParams === undefined ? undefined : (0, tsafe_1.noUndefined)(getExtraTokenParams())
|
|
315
|
-
})
|
|
316
|
-
.then(function () { return new Promise(function () { }); })];
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
apply_transform_url: {
|
|
144
|
+
if (transformUrlBeforeRedirect === undefined) {
|
|
145
|
+
break apply_transform_url;
|
|
146
|
+
}
|
|
147
|
+
url = transformUrlBeforeRedirect(url);
|
|
148
|
+
}
|
|
149
|
+
update_state: {
|
|
150
|
+
if (url_before === undefined) {
|
|
151
|
+
break update_state;
|
|
152
|
+
}
|
|
153
|
+
const paramValueByName_current = (0, urlSearchParams_1.getAllSearchParams)(url);
|
|
154
|
+
const paramValueByName_before = (0, urlSearchParams_1.getAllSearchParams)(url_before);
|
|
155
|
+
for (const [name, value_current] of Object.entries(paramValueByName_current)) {
|
|
156
|
+
const value_before = paramValueByName_before[name];
|
|
157
|
+
if (value_before === value_current) {
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
stateData.extraQueryParams[name] = value_current;
|
|
161
|
+
}
|
|
317
162
|
}
|
|
318
163
|
});
|
|
319
|
-
|
|
164
|
+
return url;
|
|
165
|
+
};
|
|
166
|
+
const redirectMethod = (() => {
|
|
167
|
+
switch (rest.action) {
|
|
168
|
+
case "login":
|
|
169
|
+
return rest.doNavigateBackToLastPublicUrlIfTheTheUserNavigateBack
|
|
170
|
+
? "replace"
|
|
171
|
+
: "assign";
|
|
172
|
+
case "go to auth server":
|
|
173
|
+
return "assign";
|
|
174
|
+
}
|
|
175
|
+
})();
|
|
176
|
+
log?.(`redirectMethod: ${redirectMethod}`);
|
|
177
|
+
return oidcClientTsUserManager
|
|
178
|
+
.signinRedirect({
|
|
179
|
+
state: stateData,
|
|
180
|
+
redirectMethod,
|
|
181
|
+
prompt: (() => {
|
|
182
|
+
switch (rest.action) {
|
|
183
|
+
case "go to auth server":
|
|
184
|
+
return undefined;
|
|
185
|
+
case "login":
|
|
186
|
+
switch (rest.interaction) {
|
|
187
|
+
case "ensure no interaction":
|
|
188
|
+
return "none";
|
|
189
|
+
case "ensure interaction":
|
|
190
|
+
return "login";
|
|
191
|
+
case "directly redirect if active session show login otherwise":
|
|
192
|
+
return undefined;
|
|
193
|
+
}
|
|
194
|
+
tsafe_1.assert;
|
|
195
|
+
}
|
|
196
|
+
tsafe_1.assert;
|
|
197
|
+
})(),
|
|
198
|
+
transformUrl: transformUrl_oidcClientTs,
|
|
199
|
+
extraTokenParams: getExtraTokenParams === undefined ? undefined : (0, tsafe_1.noUndefined)(getExtraTokenParams())
|
|
200
|
+
})
|
|
201
|
+
.then(() => new Promise(() => { }));
|
|
320
202
|
}
|
|
321
|
-
|
|
203
|
+
const { unsubscribe } = evtIsUserLoggedIn.subscribe(isLoggedIn => {
|
|
322
204
|
unsubscribe();
|
|
323
205
|
if (isLoggedIn) {
|
|
324
206
|
localStorage.removeItem(LOCAL_STORAGE_KEY_TO_CLEAR_WHEN_USER_LOGGED_IN);
|
|
325
207
|
}
|
|
326
208
|
else {
|
|
327
|
-
|
|
328
|
-
history.pushState = function pushState() {
|
|
329
|
-
var args = [];
|
|
330
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
331
|
-
args[_i] = arguments[_i];
|
|
332
|
-
}
|
|
209
|
+
const realPushState = history.pushState.bind(history);
|
|
210
|
+
history.pushState = function pushState(...args) {
|
|
333
211
|
lastPublicUrl = window.location.href;
|
|
334
|
-
return
|
|
212
|
+
return realPushState(...args);
|
|
335
213
|
};
|
|
336
214
|
}
|
|
337
|
-
})
|
|
215
|
+
});
|
|
338
216
|
return {
|
|
339
|
-
loginOrGoToAuthServer
|
|
217
|
+
loginOrGoToAuthServer
|
|
340
218
|
};
|
|
341
219
|
}
|
|
342
220
|
//# sourceMappingURL=loginOrGoToAuthServer.js.map
|