@react-keycloak-refork/web 6.0.0 → 8.0.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/LICENSE.md +24 -24
- package/README.md +7 -7
- package/lib/context.d.ts +3 -3
- package/lib/context.js +3 -3
- package/lib/context.js.map +1 -1
- package/lib/index.d.ts +3 -3
- package/lib/index.js +3 -3
- package/lib/provider.d.ts +140 -146
- package/lib/provider.js +3 -3
- package/lib/provider.js.map +1 -1
- package/lib/useKeycloak.d.ts +4 -4
- package/lib/useKeycloak.js +16 -16
- package/lib/useKeycloak.js.map +1 -1
- package/lib/withKeycloak.d.ts +43 -43
- package/lib/withKeycloak.js +24 -24
- package/lib/withKeycloak.js.map +1 -1
- package/lib-commonjs/context.d.ts +3 -3
- package/lib-commonjs/context.js +6 -6
- package/lib-commonjs/context.js.map +1 -1
- package/lib-commonjs/index.d.ts +3 -3
- package/lib-commonjs/index.js +19 -19
- package/lib-commonjs/provider.d.ts +140 -146
- package/lib-commonjs/provider.js +6 -6
- package/lib-commonjs/provider.js.map +1 -1
- package/lib-commonjs/useKeycloak.d.ts +4 -4
- package/lib-commonjs/useKeycloak.js +19 -20
- package/lib-commonjs/useKeycloak.js.map +1 -1
- package/lib-commonjs/withKeycloak.d.ts +43 -43
- package/lib-commonjs/withKeycloak.js +27 -51
- package/lib-commonjs/withKeycloak.js.map +1 -1
- package/package.json +14 -10
package/lib/withKeycloak.js
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
11
|
-
};
|
|
12
|
-
import
|
|
13
|
-
import { useKeycloak } from './useKeycloak';
|
|
14
|
-
/**
|
|
15
|
-
* An HOC which injects the `keycloak` instance and the `keycloakInitialized` flag as props.
|
|
16
|
-
*
|
|
17
|
-
* @deprecated Please migrate to useKeycloak hook where/when possible.
|
|
18
|
-
*/
|
|
19
|
-
export function withKeycloak(Component) {
|
|
20
|
-
return function WrappedComponent(props) {
|
|
21
|
-
var _a = useKeycloak(), keycloak = _a.keycloak, initialized = _a.initialized;
|
|
22
|
-
return (
|
|
23
|
-
};
|
|
24
|
-
}
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
12
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
+
import { useKeycloak } from './useKeycloak';
|
|
14
|
+
/**
|
|
15
|
+
* An HOC which injects the `keycloak` instance and the `keycloakInitialized` flag as props.
|
|
16
|
+
*
|
|
17
|
+
* @deprecated Please migrate to useKeycloak hook where/when possible.
|
|
18
|
+
*/
|
|
19
|
+
export function withKeycloak(Component) {
|
|
20
|
+
return function WrappedComponent(props) {
|
|
21
|
+
var _a = useKeycloak(), keycloak = _a.keycloak, initialized = _a.initialized;
|
|
22
|
+
return (_jsx(Component, __assign({}, props, { keycloakInitialized: initialized, keycloak: keycloak })));
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
25
|
//# sourceMappingURL=withKeycloak.js.map
|
package/lib/withKeycloak.js.map
CHANGED
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"@react-keycloak-refork\\web\\withKeycloak.tsx"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": "
|
|
9
|
+
"mappings": ";;;;;;;;;;;;AAGA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAA;AAQ3C;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAC1B,SAAiC;IAEjC,OAAO,SAAS,gBAAgB,CAAC,KAAQ;QACjC,IAAA,KAA4B,WAAW,EAAE,EAAvC,QAAQ,cAAA,EAAE,WAAW,iBAAkB,CAAA;QAE/C,OAAO,CACL,KAAC,SAAS,eACH,KAAW,IAChB,mBAAmB,EAAE,WAAW,EAChC,QAAQ,EAAE,QAAQ,IAClB,CACH,CAAA;IACH,CAAC,CAAA;AACH,CAAC"
|
|
10
10
|
}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const reactKeycloakWebContext: import("react").Context<import("@react-keycloak-
|
|
3
|
-
export declare const ReactKeycloakWebContextConsumer: import("react").Consumer<import("@react-keycloak-
|
|
1
|
+
import Keycloak from 'keycloak-js';
|
|
2
|
+
export declare const reactKeycloakWebContext: import("react").Context<import("@react-keycloak-fork/core").IAuthContextProps<Keycloak>>;
|
|
3
|
+
export declare const ReactKeycloakWebContextConsumer: import("react").Consumer<import("@react-keycloak-fork/core").IAuthContextProps<Keycloak>>;
|
package/lib-commonjs/context.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReactKeycloakWebContextConsumer = exports.reactKeycloakWebContext = void 0;
|
|
4
|
-
var core_1 = require("@react-keycloak-
|
|
5
|
-
exports.reactKeycloakWebContext = (0, core_1.createAuthContext)();
|
|
6
|
-
exports.ReactKeycloakWebContextConsumer = exports.reactKeycloakWebContext.Consumer;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReactKeycloakWebContextConsumer = exports.reactKeycloakWebContext = void 0;
|
|
4
|
+
var core_1 = require("@react-keycloak-fork/core");
|
|
5
|
+
exports.reactKeycloakWebContext = (0, core_1.createAuthContext)();
|
|
6
|
+
exports.ReactKeycloakWebContextConsumer = exports.reactKeycloakWebContext.Consumer;
|
|
7
7
|
//# sourceMappingURL=context.js.map
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"@react-keycloak-refork\\web\\context.ts"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": ";;;AAAA,
|
|
9
|
+
"mappings": ";;;AAAA,kDAA6D;AAGhD,QAAA,uBAAuB,GAAG,IAAA,wBAAiB,GAAY,CAAA;AAEvD,QAAA,+BAA+B,GAAG,+BAAuB,CAAC,QAAQ,CAAA"
|
|
10
10
|
}
|
package/lib-commonjs/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export * from './provider';
|
|
2
|
-
export * from './useKeycloak';
|
|
3
|
-
export * from './withKeycloak';
|
|
1
|
+
export * from './provider';
|
|
2
|
+
export * from './useKeycloak';
|
|
3
|
+
export * from './withKeycloak';
|
package/lib-commonjs/index.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./provider"), exports);
|
|
18
|
-
__exportStar(require("./useKeycloak"), exports);
|
|
19
|
-
__exportStar(require("./withKeycloak"), exports);
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./provider"), exports);
|
|
18
|
+
__exportStar(require("./useKeycloak"), exports);
|
|
19
|
+
__exportStar(require("./withKeycloak"), exports);
|
|
20
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,146 +1,140 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
initialized: boolean;
|
|
90
|
-
isAuthenticated: boolean;
|
|
91
|
-
isLoading: boolean;
|
|
92
|
-
}
|
|
93
|
-
initialized: boolean;
|
|
94
|
-
isAuthenticated: boolean;
|
|
95
|
-
isLoading: boolean;
|
|
96
|
-
}
|
|
97
|
-
initialized: boolean;
|
|
98
|
-
isAuthenticated: boolean;
|
|
99
|
-
isLoading: boolean;
|
|
100
|
-
}
|
|
101
|
-
initialized: boolean;
|
|
102
|
-
isAuthenticated: boolean;
|
|
103
|
-
isLoading: boolean;
|
|
104
|
-
} | Pick<{
|
|
105
|
-
initialized: boolean;
|
|
106
|
-
isAuthenticated: boolean;
|
|
107
|
-
isLoading: boolean;
|
|
108
|
-
},
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
initialized: boolean;
|
|
120
|
-
isAuthenticated: boolean;
|
|
121
|
-
isLoading: boolean;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
isAuthenticated: boolean;
|
|
142
|
-
isLoading: boolean;
|
|
143
|
-
}>, nextContext: any): void;
|
|
144
|
-
};
|
|
145
|
-
contextType?: import("react").Context<any> | undefined;
|
|
146
|
-
};
|
|
1
|
+
export declare const ReactKeycloakProvider: {
|
|
2
|
+
new (props: import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>): {
|
|
3
|
+
state: {
|
|
4
|
+
initialized: boolean;
|
|
5
|
+
isAuthenticated: boolean;
|
|
6
|
+
isLoading: boolean;
|
|
7
|
+
};
|
|
8
|
+
componentDidMount(): void;
|
|
9
|
+
componentDidUpdate({ authClient: prevAuthClient, initOptions: prevInitOptions, }: import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>): void;
|
|
10
|
+
init(): void;
|
|
11
|
+
onError: (event: import("@react-keycloak-fork/core").AuthClientEvent) => (error?: import("@react-keycloak-fork/core").AuthClientError) => void;
|
|
12
|
+
updateState: (event: import("@react-keycloak-fork/core").AuthClientEvent) => () => void;
|
|
13
|
+
refreshToken: (event: import("@react-keycloak-fork/core").AuthClientEvent) => () => void;
|
|
14
|
+
render(): React.JSX.Element;
|
|
15
|
+
context: unknown;
|
|
16
|
+
setState<K extends keyof {
|
|
17
|
+
initialized: boolean;
|
|
18
|
+
isAuthenticated: boolean;
|
|
19
|
+
isLoading: boolean;
|
|
20
|
+
}>(state: {
|
|
21
|
+
initialized: boolean;
|
|
22
|
+
isAuthenticated: boolean;
|
|
23
|
+
isLoading: boolean;
|
|
24
|
+
} | ((prevState: Readonly<{
|
|
25
|
+
initialized: boolean;
|
|
26
|
+
isAuthenticated: boolean;
|
|
27
|
+
isLoading: boolean;
|
|
28
|
+
}>, props: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>) => {
|
|
29
|
+
initialized: boolean;
|
|
30
|
+
isAuthenticated: boolean;
|
|
31
|
+
isLoading: boolean;
|
|
32
|
+
} | Pick<{
|
|
33
|
+
initialized: boolean;
|
|
34
|
+
isAuthenticated: boolean;
|
|
35
|
+
isLoading: boolean;
|
|
36
|
+
}, K> | null) | Pick<{
|
|
37
|
+
initialized: boolean;
|
|
38
|
+
isAuthenticated: boolean;
|
|
39
|
+
isLoading: boolean;
|
|
40
|
+
}, K> | null, callback?: (() => void) | undefined): void;
|
|
41
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
42
|
+
readonly props: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>;
|
|
43
|
+
shouldComponentUpdate?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>, nextState: Readonly<{
|
|
44
|
+
initialized: boolean;
|
|
45
|
+
isAuthenticated: boolean;
|
|
46
|
+
isLoading: boolean;
|
|
47
|
+
}>, nextContext: any): boolean;
|
|
48
|
+
componentWillUnmount?(): void;
|
|
49
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
50
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>, prevState: Readonly<{
|
|
51
|
+
initialized: boolean;
|
|
52
|
+
isAuthenticated: boolean;
|
|
53
|
+
isLoading: boolean;
|
|
54
|
+
}>): any;
|
|
55
|
+
componentWillMount?(): void;
|
|
56
|
+
UNSAFE_componentWillMount?(): void;
|
|
57
|
+
componentWillReceiveProps?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>, nextContext: any): void;
|
|
58
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>, nextContext: any): void;
|
|
59
|
+
componentWillUpdate?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>, nextState: Readonly<{
|
|
60
|
+
initialized: boolean;
|
|
61
|
+
isAuthenticated: boolean;
|
|
62
|
+
isLoading: boolean;
|
|
63
|
+
}>, nextContext: any): void;
|
|
64
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>, nextState: Readonly<{
|
|
65
|
+
initialized: boolean;
|
|
66
|
+
isAuthenticated: boolean;
|
|
67
|
+
isLoading: boolean;
|
|
68
|
+
}>, nextContext: any): void;
|
|
69
|
+
};
|
|
70
|
+
new (props: import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>, context: any): {
|
|
71
|
+
state: {
|
|
72
|
+
initialized: boolean;
|
|
73
|
+
isAuthenticated: boolean;
|
|
74
|
+
isLoading: boolean;
|
|
75
|
+
};
|
|
76
|
+
componentDidMount(): void;
|
|
77
|
+
componentDidUpdate({ authClient: prevAuthClient, initOptions: prevInitOptions, }: import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>): void;
|
|
78
|
+
init(): void;
|
|
79
|
+
onError: (event: import("@react-keycloak-fork/core").AuthClientEvent) => (error?: import("@react-keycloak-fork/core").AuthClientError) => void;
|
|
80
|
+
updateState: (event: import("@react-keycloak-fork/core").AuthClientEvent) => () => void;
|
|
81
|
+
refreshToken: (event: import("@react-keycloak-fork/core").AuthClientEvent) => () => void;
|
|
82
|
+
render(): React.JSX.Element;
|
|
83
|
+
context: unknown;
|
|
84
|
+
setState<K extends keyof {
|
|
85
|
+
initialized: boolean;
|
|
86
|
+
isAuthenticated: boolean;
|
|
87
|
+
isLoading: boolean;
|
|
88
|
+
}>(state: {
|
|
89
|
+
initialized: boolean;
|
|
90
|
+
isAuthenticated: boolean;
|
|
91
|
+
isLoading: boolean;
|
|
92
|
+
} | ((prevState: Readonly<{
|
|
93
|
+
initialized: boolean;
|
|
94
|
+
isAuthenticated: boolean;
|
|
95
|
+
isLoading: boolean;
|
|
96
|
+
}>, props: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>) => {
|
|
97
|
+
initialized: boolean;
|
|
98
|
+
isAuthenticated: boolean;
|
|
99
|
+
isLoading: boolean;
|
|
100
|
+
} | Pick<{
|
|
101
|
+
initialized: boolean;
|
|
102
|
+
isAuthenticated: boolean;
|
|
103
|
+
isLoading: boolean;
|
|
104
|
+
}, K> | null) | Pick<{
|
|
105
|
+
initialized: boolean;
|
|
106
|
+
isAuthenticated: boolean;
|
|
107
|
+
isLoading: boolean;
|
|
108
|
+
}, K> | null, callback?: (() => void) | undefined): void;
|
|
109
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
110
|
+
readonly props: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>;
|
|
111
|
+
shouldComponentUpdate?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>, nextState: Readonly<{
|
|
112
|
+
initialized: boolean;
|
|
113
|
+
isAuthenticated: boolean;
|
|
114
|
+
isLoading: boolean;
|
|
115
|
+
}>, nextContext: any): boolean;
|
|
116
|
+
componentWillUnmount?(): void;
|
|
117
|
+
componentDidCatch?(error: Error, errorInfo: React.ErrorInfo): void;
|
|
118
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>, prevState: Readonly<{
|
|
119
|
+
initialized: boolean;
|
|
120
|
+
isAuthenticated: boolean;
|
|
121
|
+
isLoading: boolean;
|
|
122
|
+
}>): any;
|
|
123
|
+
componentWillMount?(): void;
|
|
124
|
+
UNSAFE_componentWillMount?(): void;
|
|
125
|
+
componentWillReceiveProps?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>, nextContext: any): void;
|
|
126
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>, nextContext: any): void;
|
|
127
|
+
componentWillUpdate?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>, nextState: Readonly<{
|
|
128
|
+
initialized: boolean;
|
|
129
|
+
isAuthenticated: boolean;
|
|
130
|
+
isLoading: boolean;
|
|
131
|
+
}>, nextContext: any): void;
|
|
132
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("keycloak-js").default>>, nextState: Readonly<{
|
|
133
|
+
initialized: boolean;
|
|
134
|
+
isAuthenticated: boolean;
|
|
135
|
+
isLoading: boolean;
|
|
136
|
+
}>, nextContext: any): void;
|
|
137
|
+
};
|
|
138
|
+
contextType?: React.Context<any> | undefined;
|
|
139
|
+
propTypes?: any;
|
|
140
|
+
};
|
package/lib-commonjs/provider.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReactKeycloakProvider = void 0;
|
|
4
|
-
var core_1 = require("@react-keycloak-
|
|
5
|
-
var context_1 = require("./context");
|
|
6
|
-
exports.ReactKeycloakProvider = (0, core_1.createAuthProvider)(context_1.reactKeycloakWebContext);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReactKeycloakProvider = void 0;
|
|
4
|
+
var core_1 = require("@react-keycloak-fork/core");
|
|
5
|
+
var context_1 = require("./context");
|
|
6
|
+
exports.ReactKeycloakProvider = (0, core_1.createAuthProvider)(context_1.reactKeycloakWebContext);
|
|
7
7
|
//# sourceMappingURL=provider.js.map
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"@react-keycloak-refork\\web\\provider.ts"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": ";;;AAAA,
|
|
9
|
+
"mappings": ";;;AAAA,kDAA8D;AAE9D,qCAAmD;AAEtC,QAAA,qBAAqB,GAAG,IAAA,yBAAkB,EAAC,iCAAuB,CAAC,CAAA"
|
|
10
10
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare function useKeycloak(): {
|
|
2
|
-
initialized: boolean;
|
|
3
|
-
keycloak: import("keycloak-js
|
|
4
|
-
};
|
|
1
|
+
export declare function useKeycloak(): {
|
|
2
|
+
initialized: boolean;
|
|
3
|
+
keycloak: import("keycloak-js").default;
|
|
4
|
+
};
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.useKeycloak =
|
|
4
|
-
var react_1 = require("react");
|
|
5
|
-
var context_1 = require("./context");
|
|
6
|
-
function useKeycloak() {
|
|
7
|
-
var ctx = (0, react_1.useContext)(context_1.reactKeycloakWebContext);
|
|
8
|
-
if (!ctx) {
|
|
9
|
-
throw new Error('useKeycloak hook must be used inside ReactKeycloakProvider context');
|
|
10
|
-
}
|
|
11
|
-
if (!ctx.authClient) {
|
|
12
|
-
throw new Error('authClient has not been assigned to ReactKeycloakProvider');
|
|
13
|
-
}
|
|
14
|
-
var authClient = ctx.authClient, initialized = ctx.initialized;
|
|
15
|
-
return {
|
|
16
|
-
initialized: initialized,
|
|
17
|
-
keycloak: authClient,
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
exports.useKeycloak = useKeycloak;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useKeycloak = useKeycloak;
|
|
4
|
+
var react_1 = require("react");
|
|
5
|
+
var context_1 = require("./context");
|
|
6
|
+
function useKeycloak() {
|
|
7
|
+
var ctx = (0, react_1.useContext)(context_1.reactKeycloakWebContext);
|
|
8
|
+
if (!ctx) {
|
|
9
|
+
throw new Error('useKeycloak hook must be used inside ReactKeycloakProvider context');
|
|
10
|
+
}
|
|
11
|
+
if (!ctx.authClient) {
|
|
12
|
+
throw new Error('authClient has not been assigned to ReactKeycloakProvider');
|
|
13
|
+
}
|
|
14
|
+
var authClient = ctx.authClient, initialized = ctx.initialized;
|
|
15
|
+
return {
|
|
16
|
+
initialized: initialized,
|
|
17
|
+
keycloak: authClient,
|
|
18
|
+
};
|
|
19
|
+
}
|
|
21
20
|
//# sourceMappingURL=useKeycloak.js.map
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"@react-keycloak-refork\\web\\useKeycloak.ts"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": "
|
|
9
|
+
"mappings": ";;AAIA,kCAkBC;AAtBD,+BAAkC;AAElC,qCAAmD;AAEnD,SAAgB,WAAW;IACzB,IAAM,GAAG,GAAG,IAAA,kBAAU,EAAC,iCAAuB,CAAC,CAAA;IAE/C,IAAI,CAAC,GAAG,EAAE,CAAC;QACT,MAAM,IAAI,KAAK,CACb,oEAAoE,CACrE,CAAA;IACH,CAAC;IAED,IAAI,CAAC,GAAG,CAAC,UAAU,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAA;IAC9E,CAAC;IAEO,IAAA,UAAU,GAAkB,GAAG,WAArB,EAAE,WAAW,GAAK,GAAG,YAAR,CAAQ;IACvC,OAAO;QACL,WAAW,aAAA;QACX,QAAQ,EAAE,UAAU;KACrB,CAAA;AACH,CAAC"
|
|
10
10
|
}
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import type { KeycloakInstance } from 'keycloak-js';
|
|
2
|
-
import * as React from 'react';
|
|
3
|
-
type InjectedProps = {
|
|
4
|
-
keycloakInitialized: boolean;
|
|
5
|
-
keycloak: KeycloakInstance;
|
|
6
|
-
};
|
|
7
|
-
/**
|
|
8
|
-
* An HOC which injects the `keycloak` instance and the `keycloakInitialized` flag as props.
|
|
9
|
-
*
|
|
10
|
-
* @deprecated Please migrate to useKeycloak hook where/when possible.
|
|
11
|
-
*/
|
|
12
|
-
export declare function withKeycloak<P extends InjectedProps>(Component: React.ComponentType<P>): React.FC<Subtract<P, InjectedProps>>;
|
|
13
|
-
/**
|
|
14
|
-
* SetDifference (same as Exclude)
|
|
15
|
-
* @desc Set difference of given union types `A` and `B`
|
|
16
|
-
* @example
|
|
17
|
-
* // Expect: "1"
|
|
18
|
-
* SetDifference<'1' | '2' | '3', '2' | '3' | '4'>;
|
|
19
|
-
*
|
|
20
|
-
* // Expect: string | number
|
|
21
|
-
* SetDifference<string | number | (() => void), Function>;
|
|
22
|
-
*/
|
|
23
|
-
type SetDifference<A, B> = A extends B ? never : A;
|
|
24
|
-
/**
|
|
25
|
-
* SetComplement
|
|
26
|
-
* @desc Set complement of given union types `A` and (it's subset) `A1`
|
|
27
|
-
* @example
|
|
28
|
-
* // Expect: "1"
|
|
29
|
-
* SetComplement<'1' | '2' | '3', '2' | '3'>;
|
|
30
|
-
*/
|
|
31
|
-
type SetComplement<A, A1 extends A> = SetDifference<A, A1>;
|
|
32
|
-
/**
|
|
33
|
-
* Subtract
|
|
34
|
-
* @desc From `T` remove properties that exist in `T1` (`T1` has a subset of the properties of `T`)
|
|
35
|
-
* @example
|
|
36
|
-
* type Props = { name: string; age: number; visible: boolean };
|
|
37
|
-
* type DefaultProps = { age: number };
|
|
38
|
-
*
|
|
39
|
-
* // Expect: { name: string; visible: boolean; }
|
|
40
|
-
* type RestProps = Subtract<Props, DefaultProps>;
|
|
41
|
-
*/
|
|
42
|
-
type Subtract<T extends T1, T1 extends object> = Pick<T, SetComplement<keyof T, keyof T1>>;
|
|
43
|
-
export {};
|
|
1
|
+
import type { KeycloakInstance } from 'keycloak-js';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
type InjectedProps = {
|
|
4
|
+
keycloakInitialized: boolean;
|
|
5
|
+
keycloak: KeycloakInstance;
|
|
6
|
+
};
|
|
7
|
+
/**
|
|
8
|
+
* An HOC which injects the `keycloak` instance and the `keycloakInitialized` flag as props.
|
|
9
|
+
*
|
|
10
|
+
* @deprecated Please migrate to useKeycloak hook where/when possible.
|
|
11
|
+
*/
|
|
12
|
+
export declare function withKeycloak<P extends InjectedProps>(Component: React.ComponentType<P>): React.FC<Subtract<P, InjectedProps>>;
|
|
13
|
+
/**
|
|
14
|
+
* SetDifference (same as Exclude)
|
|
15
|
+
* @desc Set difference of given union types `A` and `B`
|
|
16
|
+
* @example
|
|
17
|
+
* // Expect: "1"
|
|
18
|
+
* SetDifference<'1' | '2' | '3', '2' | '3' | '4'>;
|
|
19
|
+
*
|
|
20
|
+
* // Expect: string | number
|
|
21
|
+
* SetDifference<string | number | (() => void), Function>;
|
|
22
|
+
*/
|
|
23
|
+
type SetDifference<A, B> = A extends B ? never : A;
|
|
24
|
+
/**
|
|
25
|
+
* SetComplement
|
|
26
|
+
* @desc Set complement of given union types `A` and (it's subset) `A1`
|
|
27
|
+
* @example
|
|
28
|
+
* // Expect: "1"
|
|
29
|
+
* SetComplement<'1' | '2' | '3', '2' | '3'>;
|
|
30
|
+
*/
|
|
31
|
+
type SetComplement<A, A1 extends A> = SetDifference<A, A1>;
|
|
32
|
+
/**
|
|
33
|
+
* Subtract
|
|
34
|
+
* @desc From `T` remove properties that exist in `T1` (`T1` has a subset of the properties of `T`)
|
|
35
|
+
* @example
|
|
36
|
+
* type Props = { name: string; age: number; visible: boolean };
|
|
37
|
+
* type DefaultProps = { age: number };
|
|
38
|
+
*
|
|
39
|
+
* // Expect: { name: string; visible: boolean; }
|
|
40
|
+
* type RestProps = Subtract<Props, DefaultProps>;
|
|
41
|
+
*/
|
|
42
|
+
type Subtract<T extends T1, T1 extends object> = Pick<T, SetComplement<keyof T, keyof T1>>;
|
|
43
|
+
export {};
|