@axa-fr/react-oidc 6.9.7 → 6.10.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +102 -102
- package/dist/FetchToken.d.ts.map +1 -1
- package/dist/FetchToken.js +2 -2
- package/dist/FetchToken.js.map +1 -1
- package/dist/OidcProvider.d.ts +7 -6
- package/dist/OidcProvider.d.ts.map +1 -1
- package/dist/OidcProvider.js +30 -26
- package/dist/OidcProvider.js.map +1 -1
- package/dist/OidcSecure.d.ts +2 -2
- package/dist/OidcSecure.d.ts.map +1 -1
- package/dist/OidcSecure.js +2 -4
- package/dist/OidcSecure.js.map +1 -1
- package/dist/OidcServiceWorker.js +150 -144
- package/dist/OidcTrustedDomains.js +9 -10
- package/dist/ReactOidc.d.ts +1 -1
- package/dist/ReactOidc.d.ts.map +1 -1
- package/dist/ReactOidc.js +22 -16
- package/dist/ReactOidc.js.map +1 -1
- package/dist/User.d.ts.map +1 -1
- package/dist/User.js +1 -1
- package/dist/User.js.map +1 -1
- package/dist/core/default-component/AuthenticateError.component.d.ts +1 -1
- package/dist/core/default-component/AuthenticateError.component.d.ts.map +1 -1
- package/dist/core/default-component/Authenticating.component.d.ts +1 -1
- package/dist/core/default-component/Authenticating.component.d.ts.map +1 -1
- package/dist/core/default-component/Callback.component.d.ts.map +1 -1
- package/dist/core/default-component/Callback.component.js +5 -5
- package/dist/core/default-component/Callback.component.js.map +1 -1
- package/dist/core/default-component/Loading.component.d.ts +1 -1
- package/dist/core/default-component/Loading.component.d.ts.map +1 -1
- package/dist/core/default-component/ServiceWorkerNotSupported.component.d.ts +1 -1
- package/dist/core/default-component/ServiceWorkerNotSupported.component.d.ts.map +1 -1
- package/dist/core/default-component/SessionLost.component.d.ts.map +1 -1
- package/dist/core/default-component/SilentCallback.component.d.ts.map +1 -1
- package/dist/core/default-component/SilentCallback.component.js +1 -0
- package/dist/core/default-component/SilentCallback.component.js.map +1 -1
- package/dist/core/default-component/SilentLogin.component.d.ts.map +1 -1
- package/dist/core/default-component/SilentLogin.component.js +5 -7
- package/dist/core/default-component/SilentLogin.component.js.map +1 -1
- package/dist/core/default-component/index.d.ts +2 -2
- package/dist/core/default-component/index.d.ts.map +1 -1
- package/dist/core/default-component/index.js +5 -5
- package/dist/core/default-component/index.js.map +1 -1
- package/dist/core/routes/OidcRoutes.d.ts +1 -1
- package/dist/core/routes/OidcRoutes.d.ts.map +1 -1
- package/dist/core/routes/OidcRoutes.js +1 -1
- package/dist/core/routes/OidcRoutes.js.map +1 -1
- package/dist/core/routes/withRouter.d.ts.map +1 -1
- package/dist/core/routes/withRouter.js.map +1 -1
- package/dist/index.d.ts +7 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +10 -10
- package/dist/index.js.map +1 -1
- package/dist/vanilla/checkSessionIFrame.d.ts.map +1 -1
- package/dist/vanilla/checkSessionIFrame.js +15 -15
- package/dist/vanilla/checkSessionIFrame.js.map +1 -1
- package/dist/vanilla/initSession.d.ts.map +1 -1
- package/dist/vanilla/initSession.js +1 -1
- package/dist/vanilla/initSession.js.map +1 -1
- package/dist/vanilla/initWorker.d.ts +1 -1
- package/dist/vanilla/initWorker.d.ts.map +1 -1
- package/dist/vanilla/initWorker.js +22 -20
- package/dist/vanilla/initWorker.js.map +1 -1
- package/dist/vanilla/memoryStorageBackend.d.ts +5 -4
- package/dist/vanilla/memoryStorageBackend.d.ts.map +1 -1
- package/dist/vanilla/memoryStorageBackend.js.map +1 -1
- package/dist/vanilla/noHashQueryStringUtils.d.ts +3 -3
- package/dist/vanilla/noHashQueryStringUtils.d.ts.map +1 -1
- package/dist/vanilla/noHashQueryStringUtils.js +4 -4
- package/dist/vanilla/noHashQueryStringUtils.js.map +1 -1
- package/dist/vanilla/oidc.d.ts +6 -6
- package/dist/vanilla/oidc.d.ts.map +1 -1
- package/dist/vanilla/oidc.js +215 -216
- package/dist/vanilla/oidc.js.map +1 -1
- package/dist/vanilla/parseTokens.d.ts +2 -2
- package/dist/vanilla/parseTokens.d.ts.map +1 -1
- package/dist/vanilla/parseTokens.js +8 -8
- package/dist/vanilla/parseTokens.js.map +1 -1
- package/dist/vanilla/route-utils.d.ts.map +1 -1
- package/dist/vanilla/route-utils.js +10 -7
- package/dist/vanilla/route-utils.js.map +1 -1
- package/dist/vanilla/timer.d.ts.map +1 -1
- package/dist/vanilla/timer.js +8 -8
- package/dist/vanilla/timer.js.map +1 -1
- package/dist/vanilla/vanillaOidc.d.ts +6 -4
- package/dist/vanilla/vanillaOidc.d.ts.map +1 -1
- package/dist/vanilla/vanillaOidc.js +4 -5
- package/dist/vanilla/vanillaOidc.js.map +1 -1
- package/package.json +15 -6
- package/src/oidc/FetchToken.tsx +10 -11
- package/src/oidc/OidcProvider.tsx +82 -83
- package/src/oidc/OidcSecure.tsx +16 -18
- package/src/oidc/ReactOidc.tsx +74 -63
- package/src/oidc/User.ts +14 -13
- package/src/oidc/core/default-component/AuthenticateError.component.tsx +1 -1
- package/src/oidc/core/default-component/Authenticating.component.tsx +1 -1
- package/src/oidc/core/default-component/Callback.component.tsx +18 -18
- package/src/oidc/core/default-component/Loading.component.tsx +1 -1
- package/src/oidc/core/default-component/ServiceWorkerNotSupported.component.tsx +1 -1
- package/src/oidc/core/default-component/SessionLost.component.tsx +1 -1
- package/src/oidc/core/default-component/SilentCallback.component.tsx +7 -6
- package/src/oidc/core/default-component/SilentLogin.component.tsx +16 -18
- package/src/oidc/core/default-component/index.ts +2 -2
- package/src/oidc/core/routes/OidcRoutes.tsx +16 -15
- package/src/oidc/core/routes/withRouter.tsx +2 -4
- package/src/oidc/index.ts +7 -6
- package/src/oidc/vanilla/OidcServiceWorker.js +150 -144
- package/src/oidc/vanilla/OidcTrustedDomains.js +9 -10
- package/src/oidc/vanilla/checkSessionIFrame.ts +24 -23
- package/src/oidc/vanilla/index.ts +2 -1
- package/src/oidc/vanilla/initSession.ts +36 -37
- package/src/oidc/vanilla/initWorker.ts +82 -83
- package/src/oidc/vanilla/memoryStorageBackend.ts +13 -6
- package/src/oidc/vanilla/noHashQueryStringUtils.ts +13 -13
- package/src/oidc/vanilla/oidc.ts +460 -467
- package/src/oidc/vanilla/parseTokens.ts +73 -79
- package/src/oidc/vanilla/route-utils.ts +18 -18
- package/src/oidc/vanilla/timer.ts +14 -16
- package/src/oidc/vanilla/vanillaOidc.ts +35 -19
- package/src/override/AuthenticateError.component.tsx +4 -3
- package/src/override/Authenticating.component.tsx +4 -3
- package/src/override/Callback.component.tsx +4 -3
- package/src/override/Loading.component.tsx +4 -6
- package/src/override/ServiceWorkerNotSupported.component.tsx +5 -5
- package/src/override/SessionLost.component.tsx +8 -7
- package/src/override/style.ts +12 -10
- package/dist/core/routes/index.d.ts +0 -3
- package/dist/core/routes/index.d.ts.map +0 -1
- package/dist/core/routes/index.js +0 -9
- package/dist/core/routes/index.js.map +0 -1
- package/dist/vanilla/index.d.ts +0 -2
- package/dist/vanilla/index.d.ts.map +0 -1
- package/dist/vanilla/index.js +0 -6
- package/dist/vanilla/index.js.map +0 -1
- package/src/App.css +0 -38
- package/src/App.specold.tsx +0 -46
- package/src/App.tsx +0 -103
- package/src/FetchUser.tsx +0 -53
- package/src/Home.tsx +0 -23
- package/src/MultiAuth.tsx +0 -129
- package/src/Profile.tsx +0 -81
- package/src/configurations.ts +0 -73
- package/src/index.css +0 -13
- package/src/index.tsx +0 -9
- package/src/logo.svg +0 -7
- package/src/setupTests.js +0 -5
package/src/oidc/User.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { useEffect, useState } from 'react';
|
|
2
|
+
|
|
3
|
+
import { VanillaOidc } from './vanilla/vanillaOidc';
|
|
3
4
|
|
|
4
5
|
export enum OidcUserStatus {
|
|
5
6
|
Unauthenticated= 'Unauthenticated',
|
|
@@ -9,8 +10,8 @@ export enum OidcUserStatus {
|
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export type OidcUser<T extends OidcUserInfo = OidcUserInfo> = {
|
|
12
|
-
user: T
|
|
13
|
-
status: OidcUserStatus
|
|
13
|
+
user: T;
|
|
14
|
+
status: OidcUserStatus;
|
|
14
15
|
}
|
|
15
16
|
|
|
16
17
|
export interface OidcUserInfo {
|
|
@@ -45,24 +46,24 @@ export interface OidcAddressClaim {
|
|
|
45
46
|
country?: string;
|
|
46
47
|
}
|
|
47
48
|
|
|
48
|
-
export const useOidcUser = <T extends OidcUserInfo = OidcUserInfo>(configurationName=
|
|
49
|
-
const [oidcUser, setOidcUser] = useState<OidcUser<T>>({user: null, status: OidcUserStatus.Unauthenticated});
|
|
49
|
+
export const useOidcUser = <T extends OidcUserInfo = OidcUserInfo>(configurationName = 'default') => {
|
|
50
|
+
const [oidcUser, setOidcUser] = useState<OidcUser<T>>({ user: null, status: OidcUserStatus.Unauthenticated });
|
|
50
51
|
|
|
51
52
|
const oidc = VanillaOidc.get(configurationName);
|
|
52
53
|
useEffect(() => {
|
|
53
54
|
let isMounted = true;
|
|
54
|
-
if(oidc && oidc.tokens) {
|
|
55
|
-
setOidcUser({...oidcUser, status: OidcUserStatus.Loading});
|
|
55
|
+
if (oidc && oidc.tokens) {
|
|
56
|
+
setOidcUser({ ...oidcUser, status: OidcUserStatus.Loading });
|
|
56
57
|
oidc.userInfoAsync()
|
|
57
58
|
.then((info) => {
|
|
58
59
|
if (isMounted) {
|
|
59
|
-
setOidcUser({user: info, status: OidcUserStatus.Loaded});
|
|
60
|
+
setOidcUser({ user: info, status: OidcUserStatus.Loaded });
|
|
60
61
|
}
|
|
61
62
|
})
|
|
62
|
-
.catch(() => setOidcUser({...oidcUser, status: OidcUserStatus.LoadingError}));
|
|
63
|
+
.catch(() => setOidcUser({ ...oidcUser, status: OidcUserStatus.LoadingError }));
|
|
63
64
|
}
|
|
64
|
-
return
|
|
65
|
+
return () => { isMounted = false; };
|
|
65
66
|
}, []);
|
|
66
67
|
|
|
67
|
-
return {oidcUser: oidcUser.user, oidcUserLoadingState: oidcUser.status}
|
|
68
|
-
}
|
|
68
|
+
return { oidcUser: oidcUser.user, oidcUserLoadingState: oidcUser.status };
|
|
69
|
+
};
|
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
import React, {useEffect, useState
|
|
2
|
-
import AuthenticatingError from "./AuthenticateError.component";
|
|
3
|
-
import {VanillaOidc} from "../../vanilla/vanillaOidc";
|
|
4
|
-
import {getCustomHistory} from "../routes/withRouter";
|
|
1
|
+
import React, { ComponentType, useEffect, useState } from 'react';
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
import { VanillaOidc } from '../../vanilla/vanillaOidc';
|
|
4
|
+
import { getCustomHistory } from '../routes/withRouter';
|
|
5
|
+
import AuthenticatingError from './AuthenticateError.component';
|
|
6
|
+
|
|
7
|
+
export const CallBackSuccess: ComponentType<any> = () => (<div className="oidc-callback">
|
|
7
8
|
<div className="oidc-callback__container">
|
|
8
9
|
<h1 className="oidc-callback__title">Authentication complete</h1>
|
|
9
10
|
<p className="oidc-callback__content">You will be redirected to your application.</p>
|
|
10
11
|
</div>
|
|
11
12
|
</div>);
|
|
12
13
|
|
|
13
|
-
const CallbackManager: ComponentType<any> = ({callBackError, callBackSuccess, configurationName, withCustomHistory }) => {
|
|
14
|
-
|
|
15
|
-
const [error, setError] = useState(false);
|
|
14
|
+
const CallbackManager: ComponentType<any> = ({ callBackError, callBackSuccess, configurationName, withCustomHistory }) => {
|
|
15
|
+
const [isError, setIsError] = useState(false);
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
let isMounted = true;
|
|
18
18
|
const playCallbackAsync = async () => {
|
|
19
|
-
const getOidc =
|
|
19
|
+
const getOidc = VanillaOidc.get;
|
|
20
20
|
try {
|
|
21
|
-
const {callbackPath} = await getOidc(configurationName).loginCallbackAsync();
|
|
22
|
-
const history = (withCustomHistory)? withCustomHistory(): getCustomHistory();
|
|
23
|
-
history.replaceState(callbackPath ||
|
|
21
|
+
const { callbackPath } = await getOidc(configurationName).loginCallbackAsync();
|
|
22
|
+
const history = (withCustomHistory) ? withCustomHistory() : getCustomHistory();
|
|
23
|
+
history.replaceState(callbackPath || '/');
|
|
24
24
|
} catch (error) {
|
|
25
|
-
if(isMounted) {
|
|
26
|
-
|
|
25
|
+
if (isMounted) {
|
|
26
|
+
setIsError(true);
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
};
|
|
@@ -31,15 +31,15 @@ const CallbackManager: ComponentType<any> = ({callBackError, callBackSuccess, co
|
|
|
31
31
|
return () => {
|
|
32
32
|
isMounted = false;
|
|
33
33
|
};
|
|
34
|
-
},[]);
|
|
34
|
+
}, []);
|
|
35
35
|
|
|
36
36
|
const CallbackErrorComponent = callBackError || AuthenticatingError;
|
|
37
37
|
const CallbackSuccessComponent = callBackSuccess || CallBackSuccess;
|
|
38
38
|
|
|
39
|
-
if(
|
|
40
|
-
return <CallbackErrorComponent configurationName={configurationName}
|
|
39
|
+
if (isError) {
|
|
40
|
+
return <CallbackErrorComponent configurationName={configurationName} />;
|
|
41
41
|
}
|
|
42
|
-
|
|
42
|
+
|
|
43
43
|
return <CallbackSuccessComponent configurationName={configurationName} />;
|
|
44
44
|
};
|
|
45
45
|
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {VanillaOidc} from "../../vanilla/vanillaOidc"
|
|
1
|
+
import { ComponentType, useEffect } from 'react';
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
import { VanillaOidc } from '../../vanilla/vanillaOidc';
|
|
5
4
|
|
|
5
|
+
const CallbackManager: ComponentType<any> = ({ configurationName }) => {
|
|
6
6
|
useEffect(() => {
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
7
8
|
let isMounted = true;
|
|
8
9
|
const playCallbackAsync = async () => {
|
|
9
|
-
const getOidc =
|
|
10
|
+
const getOidc = VanillaOidc.get;
|
|
10
11
|
const oidc = getOidc(configurationName);
|
|
11
12
|
oidc.silentLoginCallbackAsync();
|
|
12
13
|
};
|
|
@@ -14,9 +15,9 @@ const CallbackManager: ComponentType<any> = ({configurationName }) => {
|
|
|
14
15
|
return () => {
|
|
15
16
|
isMounted = false;
|
|
16
17
|
};
|
|
17
|
-
},[]);
|
|
18
|
+
}, []);
|
|
18
19
|
|
|
19
20
|
return <></>;
|
|
20
21
|
};
|
|
21
22
|
|
|
22
|
-
export default CallbackManager;
|
|
23
|
+
export default CallbackManager;
|
|
@@ -1,35 +1,33 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {VanillaOidc} from "../../vanilla/vanillaOidc";
|
|
3
|
-
import {getParseQueryStringFromLocation} from "../../vanilla/route-utils";
|
|
1
|
+
import { ComponentType, useEffect } from 'react';
|
|
4
2
|
|
|
3
|
+
import { getParseQueryStringFromLocation } from '../../vanilla/route-utils';
|
|
4
|
+
import { VanillaOidc } from '../../vanilla/vanillaOidc';
|
|
5
5
|
|
|
6
|
-
const SilentLogin: ComponentType<any> = (
|
|
6
|
+
const SilentLogin: ComponentType<any> = ({ configurationName }) => {
|
|
7
7
|
const queryParams = getParseQueryStringFromLocation(window.location.href);
|
|
8
8
|
|
|
9
|
-
const getOidc =
|
|
9
|
+
const getOidc = VanillaOidc.get;
|
|
10
10
|
const oidc = getOidc(configurationName);
|
|
11
|
-
|
|
12
|
-
let extras = null;
|
|
13
11
|
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
let extras = null;
|
|
13
|
+
|
|
14
|
+
for (const [key, value] of Object.entries(queryParams)) {
|
|
15
|
+
if (key === 'state' || key === 'scope') {
|
|
16
16
|
continue;
|
|
17
17
|
}
|
|
18
|
-
if(extras === null){
|
|
18
|
+
if (extras === null) {
|
|
19
19
|
extras = {};
|
|
20
20
|
}
|
|
21
21
|
extras[key] = value;
|
|
22
22
|
}
|
|
23
|
-
|
|
23
|
+
|
|
24
24
|
useEffect(() => {
|
|
25
|
-
if(!oidc.tokens){
|
|
26
|
-
oidc.loginAsync(null, extras,
|
|
27
|
-
}
|
|
28
|
-
return () => {
|
|
25
|
+
if (!oidc.tokens) {
|
|
26
|
+
oidc.loginAsync(null, extras, true, queryParams.scope);
|
|
29
27
|
}
|
|
30
28
|
}, []);
|
|
31
|
-
|
|
29
|
+
|
|
32
30
|
return <></>;
|
|
33
|
-
}
|
|
31
|
+
};
|
|
34
32
|
|
|
35
|
-
export default SilentLogin;
|
|
33
|
+
export default SilentLogin;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
+
export { default as AuthenticateError } from './AuthenticateError.component';
|
|
1
2
|
export { default as Authenticating } from './Authenticating.component';
|
|
2
3
|
export { default as Callback, CallBackSuccess } from './Callback.component';
|
|
3
|
-
export { default as SessionLost } from './SessionLost.component';
|
|
4
4
|
export { default as Loading } from './Loading.component';
|
|
5
|
-
export { default as AuthenticateError } from './AuthenticateError.component';
|
|
6
5
|
export { default as ServiceWorkerNotSupported } from './ServiceWorkerNotSupported.component';
|
|
6
|
+
export { default as SessionLost } from './SessionLost.component';
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import React, { ComponentType, FC, PropsWithChildren, useEffect, useState } from 'react';
|
|
2
|
+
|
|
2
3
|
import { getPath } from '../../vanilla/route-utils';
|
|
3
4
|
import CallbackComponent from '../default-component/Callback.component';
|
|
4
|
-
import SilentCallbackComponent from
|
|
5
|
-
import
|
|
6
|
-
import
|
|
5
|
+
import SilentCallbackComponent from '../default-component/SilentCallback.component';
|
|
6
|
+
import SilentLoginComponent from '../default-component/SilentLogin.component';
|
|
7
|
+
import { CustomHistory } from './withRouter';
|
|
7
8
|
|
|
8
9
|
const defaultProps: Partial<OidcRoutesProps> = {
|
|
9
10
|
|
|
@@ -27,34 +28,34 @@ const OidcRoutes: FC<PropsWithChildren<OidcRoutesProps>> = ({
|
|
|
27
28
|
silent_redirect_uri,
|
|
28
29
|
silent_login_uri,
|
|
29
30
|
children, configurationName,
|
|
30
|
-
withCustomHistory=null,
|
|
31
|
+
withCustomHistory = null,
|
|
31
32
|
}) => {
|
|
32
33
|
// This exist because in next.js window outside useEffect is null
|
|
33
|
-
|
|
34
|
-
|
|
34
|
+
const pathname = window ? getPath(window.location.href) : '';
|
|
35
|
+
|
|
35
36
|
const [path, setPath] = useState(pathname);
|
|
36
|
-
|
|
37
|
+
|
|
37
38
|
useEffect(() => {
|
|
38
39
|
const setNewPath = () => setPath(getPath(window.location.href));
|
|
39
40
|
setNewPath();
|
|
40
41
|
window.addEventListener('popstate', setNewPath, false);
|
|
41
42
|
return () => window.removeEventListener('popstate', setNewPath, false);
|
|
42
43
|
}, []);
|
|
43
|
-
|
|
44
|
+
|
|
44
45
|
const callbackPath = getPath(redirect_uri);
|
|
45
46
|
|
|
46
|
-
if(silent_redirect_uri){
|
|
47
|
-
if(path === getPath(silent_redirect_uri)){
|
|
48
|
-
return <SilentCallbackComponent configurationName={configurationName}
|
|
47
|
+
if (silent_redirect_uri) {
|
|
48
|
+
if (path === getPath(silent_redirect_uri)) {
|
|
49
|
+
return <SilentCallbackComponent configurationName={configurationName} />;
|
|
49
50
|
}
|
|
50
51
|
}
|
|
51
52
|
|
|
52
|
-
if(silent_login_uri){
|
|
53
|
-
if(path === getPath(silent_login_uri)){
|
|
54
|
-
return <SilentLoginComponent configurationName={configurationName}
|
|
53
|
+
if (silent_login_uri) {
|
|
54
|
+
if (path === getPath(silent_login_uri)) {
|
|
55
|
+
return <SilentLoginComponent configurationName={configurationName} />;
|
|
55
56
|
}
|
|
56
57
|
}
|
|
57
|
-
|
|
58
|
+
|
|
58
59
|
switch (path) {
|
|
59
60
|
case callbackPath:
|
|
60
61
|
return <CallbackComponent callBackError={callbackErrorComponent} callBackSuccess={callbackSuccessComponent} configurationName={configurationName} withCustomHistory={withCustomHistory} />;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
|
|
3
1
|
const generateKey = () =>
|
|
4
2
|
Math.random()
|
|
5
3
|
.toString(36)
|
|
@@ -24,7 +22,7 @@ type InitCustomEventParams<T = any> = {
|
|
|
24
22
|
// IE Polyfill for CustomEvent
|
|
25
23
|
export const CreateEvent = (windowInternal: WindowInternal, documentInternal: Document) => (
|
|
26
24
|
event: string,
|
|
27
|
-
params: InitCustomEventParams
|
|
25
|
+
params: InitCustomEventParams,
|
|
28
26
|
): CustomEvent => {
|
|
29
27
|
if (typeof windowInternal.CustomEvent === 'function') {
|
|
30
28
|
return new windowInternal.CustomEvent(event, params);
|
|
@@ -49,7 +47,7 @@ export type CustomHistory = {
|
|
|
49
47
|
const getHistory = (
|
|
50
48
|
windowInternal: WindowInternal,
|
|
51
49
|
CreateEventInternal: (event: string, params?: InitCustomEventParams) => CustomEvent,
|
|
52
|
-
generateKeyInternal: typeof generateKey
|
|
50
|
+
generateKeyInternal: typeof generateKey,
|
|
53
51
|
): CustomHistory => {
|
|
54
52
|
return {
|
|
55
53
|
replaceState: (url?: string | null, stateHistory?: WindowHistoryState): void => {
|
package/src/oidc/index.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
6
|
-
export {
|
|
1
|
+
export { useOidcFetch, withOidcFetch } from './FetchToken';
|
|
2
|
+
export { OidcProvider } from './OidcProvider';
|
|
3
|
+
export { OidcSecure, withOidcSecure } from './OidcSecure';
|
|
4
|
+
export { useOidc, useOidcAccessToken, useOidcIdToken } from './ReactOidc';
|
|
5
|
+
export { OidcUserStatus, useOidcUser } from './User';
|
|
6
|
+
export type { OidcConfiguration } from './vanilla/oidc';
|
|
7
|
+
export { TokenRenewMode } from './vanilla/parseTokens';
|