@react-keycloak-refork/ssr 6.0.4 → 8.0.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/LICENSE.md +24 -24
- package/README.md +11 -11
- package/lib/SSRKeycloakProvider.d.ts +20 -20
- package/lib/SSRKeycloakProvider.js +78 -77
- package/lib/SSRKeycloakProvider.js.map +1 -1
- package/lib/index.d.ts +7 -7
- package/lib/index.js +7 -7
- package/lib/internals/KeycloakProvider.d.ts +140 -146
- package/lib/internals/KeycloakProvider.js +3 -3
- package/lib/internals/KeycloakProvider.js.map +1 -1
- package/lib/internals/context.d.ts +3 -4
- package/lib/internals/context.js +7 -7
- package/lib/internals/context.js.map +1 -1
- package/lib/internals/keycloak.d.ts +5 -5
- package/lib/internals/keycloak.js +30 -34
- package/lib/internals/keycloak.js.map +1 -1
- package/lib/internals/utils.d.ts +1 -1
- package/lib/internals/utils.js +1 -1
- package/lib/persistors/client.d.ts +11 -11
- package/lib/persistors/client.js +25 -25
- package/lib/persistors/server.d.ts +3 -3
- package/lib/persistors/server.js +33 -33
- package/lib/persistors/types.d.ts +22 -22
- package/lib/persistors/types.js +1 -1
- package/lib/persistors/utils.d.ts +5 -5
- package/lib/persistors/utils.js +19 -19
- package/lib/persistors/utils.js.map +1 -1
- package/lib/types.d.ts +6 -6
- package/lib/types.js +1 -1
- package/lib/useKeycloak.d.ts +6 -6
- package/lib/useKeycloak.js +11 -11
- package/lib/withKeycloak.d.ts +43 -43
- package/lib/withKeycloak.js +24 -24
- package/lib/withKeycloak.js.map +1 -1
- package/lib-commonjs/SSRKeycloakProvider.d.ts +20 -20
- package/lib-commonjs/SSRKeycloakProvider.js +114 -103
- package/lib-commonjs/SSRKeycloakProvider.js.map +1 -1
- package/lib-commonjs/index.d.ts +7 -7
- package/lib-commonjs/index.js +28 -28
- package/lib-commonjs/internals/KeycloakProvider.d.ts +140 -146
- package/lib-commonjs/internals/KeycloakProvider.js +6 -6
- package/lib-commonjs/internals/KeycloakProvider.js.map +1 -1
- package/lib-commonjs/internals/context.d.ts +3 -4
- package/lib-commonjs/internals/context.js +10 -10
- package/lib-commonjs/internals/context.js.map +1 -1
- package/lib-commonjs/internals/keycloak.d.ts +5 -5
- package/lib-commonjs/internals/keycloak.js +35 -39
- package/lib-commonjs/internals/keycloak.js.map +1 -1
- package/lib-commonjs/internals/utils.d.ts +1 -1
- package/lib-commonjs/internals/utils.js +5 -5
- package/lib-commonjs/persistors/client.d.ts +11 -11
- package/lib-commonjs/persistors/client.js +28 -28
- package/lib-commonjs/persistors/server.d.ts +3 -3
- package/lib-commonjs/persistors/server.js +38 -38
- package/lib-commonjs/persistors/types.d.ts +22 -22
- package/lib-commonjs/persistors/types.js +2 -2
- package/lib-commonjs/persistors/utils.d.ts +5 -5
- package/lib-commonjs/persistors/utils.js +29 -30
- package/lib-commonjs/persistors/utils.js.map +1 -1
- package/lib-commonjs/types.d.ts +6 -6
- package/lib-commonjs/types.js +2 -2
- package/lib-commonjs/useKeycloak.d.ts +6 -6
- package/lib-commonjs/useKeycloak.js +14 -15
- 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 +11 -10
package/lib-commonjs/index.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
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
|
-
exports.getKeycloakInstance = exports.withKeycloak = exports.useKeycloak = exports.SSRKeycloakProvider = void 0;
|
|
18
|
-
var SSRKeycloakProvider_1 = require("./SSRKeycloakProvider");
|
|
19
|
-
Object.defineProperty(exports, "SSRKeycloakProvider", { enumerable: true, get: function () { return SSRKeycloakProvider_1.SSRKeycloakProvider; } });
|
|
20
|
-
var useKeycloak_1 = require("./useKeycloak");
|
|
21
|
-
Object.defineProperty(exports, "useKeycloak", { enumerable: true, get: function () { return useKeycloak_1.useKeycloak; } });
|
|
22
|
-
var withKeycloak_1 = require("./withKeycloak");
|
|
23
|
-
Object.defineProperty(exports, "withKeycloak", { enumerable: true, get: function () { return withKeycloak_1.withKeycloak; } });
|
|
24
|
-
var keycloak_1 = require("./internals/keycloak");
|
|
25
|
-
Object.defineProperty(exports, "getKeycloakInstance", { enumerable: true, get: function () { return keycloak_1.getKeycloakInstance; } });
|
|
26
|
-
__exportStar(require("./persistors/client"), exports);
|
|
27
|
-
__exportStar(require("./persistors/server"), exports);
|
|
28
|
-
__exportStar(require("./types"), 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
|
+
exports.getKeycloakInstance = exports.withKeycloak = exports.useKeycloak = exports.SSRKeycloakProvider = void 0;
|
|
18
|
+
var SSRKeycloakProvider_1 = require("./SSRKeycloakProvider");
|
|
19
|
+
Object.defineProperty(exports, "SSRKeycloakProvider", { enumerable: true, get: function () { return SSRKeycloakProvider_1.SSRKeycloakProvider; } });
|
|
20
|
+
var useKeycloak_1 = require("./useKeycloak");
|
|
21
|
+
Object.defineProperty(exports, "useKeycloak", { enumerable: true, get: function () { return useKeycloak_1.useKeycloak; } });
|
|
22
|
+
var withKeycloak_1 = require("./withKeycloak");
|
|
23
|
+
Object.defineProperty(exports, "withKeycloak", { enumerable: true, get: function () { return withKeycloak_1.withKeycloak; } });
|
|
24
|
+
var keycloak_1 = require("./internals/keycloak");
|
|
25
|
+
Object.defineProperty(exports, "getKeycloakInstance", { enumerable: true, get: function () { return keycloak_1.getKeycloakInstance; } });
|
|
26
|
+
__exportStar(require("./persistors/client"), exports);
|
|
27
|
+
__exportStar(require("./persistors/server"), exports);
|
|
28
|
+
__exportStar(require("./types"), exports);
|
|
29
29
|
//# 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 KeycloakProvider: {
|
|
2
|
+
new (props: import("@react-keycloak-fork/core").AuthProviderProps<import("@react-keycloak-fork/core").AuthClient>): {
|
|
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("@react-keycloak-fork/core").AuthClient>): 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("@react-keycloak-fork/core").AuthClient>>) => {
|
|
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("@react-keycloak-fork/core").AuthClient>>;
|
|
43
|
+
shouldComponentUpdate?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("@react-keycloak-fork/core").AuthClient>>, 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("@react-keycloak-fork/core").AuthClient>>, 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("@react-keycloak-fork/core").AuthClient>>, nextContext: any): void;
|
|
58
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("@react-keycloak-fork/core").AuthClient>>, nextContext: any): void;
|
|
59
|
+
componentWillUpdate?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("@react-keycloak-fork/core").AuthClient>>, 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("@react-keycloak-fork/core").AuthClient>>, 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("@react-keycloak-fork/core").AuthClient>, 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("@react-keycloak-fork/core").AuthClient>): 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("@react-keycloak-fork/core").AuthClient>>) => {
|
|
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("@react-keycloak-fork/core").AuthClient>>;
|
|
111
|
+
shouldComponentUpdate?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("@react-keycloak-fork/core").AuthClient>>, 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("@react-keycloak-fork/core").AuthClient>>, 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("@react-keycloak-fork/core").AuthClient>>, nextContext: any): void;
|
|
126
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("@react-keycloak-fork/core").AuthClient>>, nextContext: any): void;
|
|
127
|
+
componentWillUpdate?(nextProps: Readonly<import("@react-keycloak-fork/core").AuthProviderProps<import("@react-keycloak-fork/core").AuthClient>>, 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("@react-keycloak-fork/core").AuthClient>>, 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
|
+
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.KeycloakProvider = void 0;
|
|
4
|
-
var core_1 = require("@react-keycloak-
|
|
5
|
-
var context_1 = require("./context");
|
|
6
|
-
exports.KeycloakProvider = (0, core_1.createAuthProvider)(context_1.reactKeycloakSsrContext);
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KeycloakProvider = void 0;
|
|
4
|
+
var core_1 = require("@react-keycloak-fork/core");
|
|
5
|
+
var context_1 = require("./context");
|
|
6
|
+
exports.KeycloakProvider = (0, core_1.createAuthProvider)(context_1.reactKeycloakSsrContext);
|
|
7
7
|
//# sourceMappingURL=KeycloakProvider.js.map
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"@react-keycloak-refork\\ssr\\internals\\KeycloakProvider.ts"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": ";;;AAAA,
|
|
9
|
+
"mappings": ";;;AAAA,kDAA8D;AAE9D,qCAAmD;AAEtC,QAAA,gBAAgB,GAAG,IAAA,yBAAkB,EAAC,iCAAuB,CAAC,CAAA"
|
|
10
10
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
export declare const
|
|
4
|
-
export declare const ReactKeycloakSSRContextConsumer: import("react").Consumer<import("@react-keycloak-refork/core").IAuthContextProps<AuthClient>>;
|
|
1
|
+
import type { AuthClient } from '@react-keycloak-fork/core';
|
|
2
|
+
export declare const reactKeycloakSsrContext: import("react").Context<import("@react-keycloak-fork/core").IAuthContextProps<AuthClient>>;
|
|
3
|
+
export declare const ReactKeycloakSSRContextConsumer: import("react").Consumer<import("@react-keycloak-fork/core").IAuthContextProps<AuthClient>>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ReactKeycloakSSRContextConsumer = exports.reactKeycloakSsrContext = void 0;
|
|
4
|
-
var core_1 = require("@react-keycloak-
|
|
5
|
-
var utils_1 = require("./utils");
|
|
6
|
-
// Context to hold Keycloak and his state
|
|
7
|
-
exports.reactKeycloakSsrContext = (0, core_1.createAuthContext)({
|
|
8
|
-
initialized: (0, utils_1.isServer)(),
|
|
9
|
-
});
|
|
10
|
-
exports.ReactKeycloakSSRContextConsumer = exports.reactKeycloakSsrContext.Consumer;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ReactKeycloakSSRContextConsumer = exports.reactKeycloakSsrContext = void 0;
|
|
4
|
+
var core_1 = require("@react-keycloak-fork/core");
|
|
5
|
+
var utils_1 = require("./utils");
|
|
6
|
+
// Context to hold Keycloak and his state
|
|
7
|
+
exports.reactKeycloakSsrContext = (0, core_1.createAuthContext)({
|
|
8
|
+
initialized: (0, utils_1.isServer)(),
|
|
9
|
+
});
|
|
10
|
+
exports.ReactKeycloakSSRContextConsumer = exports.reactKeycloakSsrContext.Consumer;
|
|
11
11
|
//# sourceMappingURL=context.js.map
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"@react-keycloak-refork\\ssr\\internals\\context.ts"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": ";;;AAAA,
|
|
9
|
+
"mappings": ";;;AAAA,kDAA6D;AAG7D,iCAAkC;AAElC,yCAAyC;AAC5B,QAAA,uBAAuB,GAAG,IAAA,wBAAiB,EAAa;IACnE,WAAW,EAAE,IAAA,gBAAQ,GAAE;CACxB,CAAC,CAAA;AAEW,QAAA,+BAA+B,GAAG,+BAAuB,CAAC,QAAQ,CAAA"
|
|
10
10
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { AuthClient } from '@react-keycloak-
|
|
2
|
-
import type { KeycloakConfig } from 'keycloak-js';
|
|
3
|
-
import type { TokenPersistor } from '../persistors/types';
|
|
4
|
-
export declare const getKeycloakStub: (persistor: TokenPersistor) => AuthClient;
|
|
5
|
-
export declare const getKeycloakInstance: (keycloakConfig: KeycloakConfig, persistor?: TokenPersistor, recreate?: boolean) => AuthClient;
|
|
1
|
+
import type { AuthClient } from '@react-keycloak-fork/core';
|
|
2
|
+
import type { KeycloakConfig } from 'keycloak-js';
|
|
3
|
+
import type { TokenPersistor } from '../persistors/types';
|
|
4
|
+
export declare const getKeycloakStub: (persistor: TokenPersistor) => AuthClient;
|
|
5
|
+
export declare const getKeycloakInstance: (keycloakConfig: KeycloakConfig, persistor?: TokenPersistor, recreate?: boolean) => AuthClient;
|
|
@@ -1,40 +1,36 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
exports
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
if (recreate
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
}
|
|
37
|
-
return !isServerCheck ? keycloakInstance : (0, exports.getKeycloakStub)(persistor);
|
|
38
|
-
};
|
|
39
|
-
exports.getKeycloakInstance = getKeycloakInstance;
|
|
1
|
+
"use strict";
|
|
2
|
+
var _a;
|
|
3
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
+
exports.getKeycloakInstance = exports.getKeycloakStub = void 0;
|
|
5
|
+
var utils_1 = require("./utils");
|
|
6
|
+
// Keycloak singleton
|
|
7
|
+
var keycloakInstance;
|
|
8
|
+
// KeycloakStub singleton
|
|
9
|
+
var keycloakStubInstance;
|
|
10
|
+
// this is a fake Keycloak instance we use to initialize Keycloak on the server.
|
|
11
|
+
// This gets over-written as soon as Keycloak is initialized on the client.
|
|
12
|
+
var getKeycloakStub = function (persistor) {
|
|
13
|
+
var kcTokens = persistor.getTokens();
|
|
14
|
+
keycloakStubInstance = {
|
|
15
|
+
init: function () { return Promise.resolve(true); },
|
|
16
|
+
updateToken: function () { return Promise.resolve(false); },
|
|
17
|
+
idToken: kcTokens.idToken,
|
|
18
|
+
token: kcTokens.token,
|
|
19
|
+
refreshToken: kcTokens.refreshToken,
|
|
20
|
+
authenticated: !!kcTokens.idToken && !!kcTokens.token,
|
|
21
|
+
};
|
|
22
|
+
return keycloakStubInstance;
|
|
23
|
+
};
|
|
24
|
+
exports.getKeycloakStub = getKeycloakStub;
|
|
25
|
+
var KeycloakModule = !(0, utils_1.isServer)() ? require('keycloak-js') : null;
|
|
26
|
+
var Keycloak = (_a = KeycloakModule === null || KeycloakModule === void 0 ? void 0 : KeycloakModule.default) !== null && _a !== void 0 ? _a : KeycloakModule;
|
|
27
|
+
var getKeycloakInstance = function (keycloakConfig, persistor, recreate) {
|
|
28
|
+
if (recreate === void 0) { recreate = false; }
|
|
29
|
+
var isServerCheck = (0, utils_1.isServer)();
|
|
30
|
+
if (recreate || (!keycloakInstance && !isServerCheck)) {
|
|
31
|
+
keycloakInstance = new Keycloak(keycloakConfig);
|
|
32
|
+
}
|
|
33
|
+
return !isServerCheck ? keycloakInstance : (0, exports.getKeycloakStub)(persistor);
|
|
34
|
+
};
|
|
35
|
+
exports.getKeycloakInstance = getKeycloakInstance;
|
|
40
36
|
//# sourceMappingURL=keycloak.js.map
|
|
@@ -6,5 +6,5 @@
|
|
|
6
6
|
"@react-keycloak-refork\\ssr\\internals\\keycloak.ts"
|
|
7
7
|
],
|
|
8
8
|
"names": [],
|
|
9
|
-
"mappings": "
|
|
9
|
+
"mappings": ";;;;AAMA,iCAAkC;AAElC,qBAAqB;AACrB,IAAI,gBAA4B,CAAA;AAEhC,yBAAyB;AACzB,IAAI,oBAAmC,CAAA;AAEvC,gFAAgF;AAChF,2EAA2E;AACpE,IAAM,eAAe,GAAG,UAAC,SAAyB;IACvD,IAAM,QAAQ,GAAG,SAAS,CAAC,SAAS,EAAE,CAAA;IAEtC,oBAAoB,GAAG;QACrB,IAAI,EAAE,cAAM,OAAA,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,EAArB,CAAqB;QACjC,WAAW,EAAE,cAAM,OAAA,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,EAAtB,CAAsB;QACzC,OAAO,EAAE,QAAQ,CAAC,OAAO;QACzB,KAAK,EAAE,QAAQ,CAAC,KAAK;QACrB,YAAY,EAAE,QAAQ,CAAC,YAAY;QACnC,aAAa,EAAE,CAAC,CAAC,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK;KAC1B,CAAA;IAE7B,OAAO,oBAAoB,CAAA;AAC7B,CAAC,CAAA;AAbY,QAAA,eAAe,mBAa3B;AAED,IAAM,cAAc,GAAG,CAAC,IAAA,gBAAQ,GAAE,CAAC,CAAC,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;AAClE,IAAM,QAAQ,GAAG,MAAA,cAAc,aAAd,cAAc,uBAAd,cAAc,CAAE,OAAO,mCAAI,cAAc,CAAA;AAEnD,IAAM,mBAAmB,GAAG,UACjC,cAA8B,EAC9B,SAA0B,EAC1B,QAAgB;IAAhB,yBAAA,EAAA,gBAAgB;IAEhB,IAAM,aAAa,GAAG,IAAA,gBAAQ,GAAE,CAAA;IAEhC,IAAI,QAAQ,IAAI,CAAC,CAAC,gBAAgB,IAAI,CAAC,aAAa,CAAC,EAAE,CAAC;QACtD,gBAAgB,GAAG,IAAI,QAAQ,CAAC,cAAc,CAAC,CAAA;IACjD,CAAC;IAED,OAAO,CAAC,aAAa,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,IAAA,uBAAe,EAAC,SAAU,CAAC,CAAA;AACxE,CAAC,CAAA;AAZY,QAAA,mBAAmB,uBAY/B"
|
|
10
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const isServer: () => boolean;
|
|
1
|
+
export declare const isServer: () => boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isServer = void 0;
|
|
4
|
-
var isServer = function () { return typeof window === 'undefined'; };
|
|
5
|
-
exports.isServer = isServer;
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isServer = void 0;
|
|
4
|
+
var isServer = function () { return typeof window === 'undefined'; };
|
|
5
|
+
exports.isServer = isServer;
|
|
6
6
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import type { AuthClientTokens } from '@react-keycloak-
|
|
2
|
-
import type { TokenPersistor } from './types';
|
|
3
|
-
export declare class Cookies implements TokenPersistor {
|
|
4
|
-
setTokens({ idToken, token }: AuthClientTokens): void;
|
|
5
|
-
getTokens(): {
|
|
6
|
-
idToken: string | undefined;
|
|
7
|
-
refreshToken: string;
|
|
8
|
-
token: string | undefined;
|
|
9
|
-
};
|
|
10
|
-
resetTokens(): void;
|
|
11
|
-
}
|
|
1
|
+
import type { AuthClientTokens } from '@react-keycloak-fork/core';
|
|
2
|
+
import type { TokenPersistor } from './types';
|
|
3
|
+
export declare class Cookies implements TokenPersistor {
|
|
4
|
+
setTokens({ idToken, token }: AuthClientTokens): void;
|
|
5
|
+
getTokens(): {
|
|
6
|
+
idToken: string | undefined;
|
|
7
|
+
refreshToken: string;
|
|
8
|
+
token: string | undefined;
|
|
9
|
+
};
|
|
10
|
+
resetTokens(): void;
|
|
11
|
+
}
|