@multiplatform.one/keycloak 0.7.2 → 0.7.3
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/lib/@types/coreJsPure.d.d.mts +2 -0
- package/lib/@types/expoKeycloakAuth.d.d.mts +28 -0
- package/lib/Authenticated.d.mts +36 -0
- package/lib/Authenticated.js +6 -6
- package/lib/Authenticated.mjs +4 -4
- package/lib/authConfig.d.mts +37 -0
- package/lib/authConfig.js +1 -1
- package/lib/authConfig.mjs +1 -1
- package/lib/{chunk-JYEIPNPN.mjs → chunk-AOKVCTMY.mjs} +1 -1
- package/lib/{chunk-73FF4BX7.js → chunk-BJ2OPIMW.js} +4 -4
- package/lib/{chunk-QFP2JWHZ.js → chunk-BTCP7NB3.js} +3 -3
- package/lib/{chunk-DJW5IKQS.mjs → chunk-DKRUDENY.mjs} +1 -1
- package/lib/{chunk-S3M2DZ6G.js → chunk-E2X33LSD.js} +2 -2
- package/lib/{chunk-RTZ3CZKS.js → chunk-FXGWERIA.js} +2 -2
- package/lib/{chunk-NRD376XV.js → chunk-HDNHCVXT.js} +2 -2
- package/lib/{chunk-BTHRDOLL.mjs → chunk-NU2SJ3ST.mjs} +1 -1
- package/lib/{chunk-K2MQYDVB.mjs → chunk-SK4YK6KE.mjs} +1 -1
- package/lib/{chunk-JLIMB5OD.js → chunk-UBCNCE73.js} +2 -2
- package/lib/{chunk-6QZDLO3M.mjs → chunk-VLUTEDDM.mjs} +1 -1
- package/lib/{chunk-CLO6HIJN.mjs → chunk-ZVG3OFME.mjs} +2 -2
- package/lib/hooks/index.d.mts +9 -0
- package/lib/hooks/index.js +6 -6
- package/lib/hooks/index.mjs +3 -3
- package/lib/hooks/useAuthConfig.d.mts +29 -0
- package/lib/hooks/useAuthConfig.js +1 -1
- package/lib/hooks/useAuthConfig.mjs +1 -1
- package/lib/hooks/useCurrentRouteName/index.d.mts +26 -0
- package/lib/hooks/useCurrentRouteName/index.js +1 -1
- package/lib/hooks/useCurrentRouteName/index.mjs +1 -1
- package/lib/hooks/useCurrentRouteName/index.native.d.mts +26 -0
- package/lib/hooks/useCurrentRouteName/index.native.js +1 -1
- package/lib/hooks/useCurrentRouteName/index.native.mjs +1 -1
- package/lib/hooks/useKeycloak/index.d.mts +70 -0
- package/lib/hooks/useKeycloak/index.js +4 -4
- package/lib/hooks/useKeycloak/index.mjs +2 -2
- package/lib/hooks/useKeycloak/useKeycloak.d.mts +2 -0
- package/lib/hooks/useKeycloak/useKeycloak.js +4 -4
- package/lib/hooks/useKeycloak/useKeycloak.mjs +2 -2
- package/lib/hooks/useKeycloak/useKeycloak.native.d.mts +44 -0
- package/lib/hooks/useKeycloak/useKeycloak.native.js +8 -8
- package/lib/hooks/useKeycloak/useKeycloak.native.mjs +1 -1
- package/lib/hooks/useLogin.d.mts +26 -0
- package/lib/hooks/useLogin.js +4 -4
- package/lib/hooks/useLogin.mjs +3 -3
- package/lib/hooks/useTokensFromQuery/index.d.mts +26 -0
- package/lib/hooks/useTokensFromQuery/index.js +1 -1
- package/lib/hooks/useTokensFromQuery/index.mjs +1 -1
- package/lib/hooks/useTokensFromQuery/index.native.d.mts +26 -0
- package/lib/hooks/useTokensFromQuery/index.native.js +1 -1
- package/lib/hooks/useTokensFromQuery/index.native.mjs +1 -1
- package/lib/hooks/useTokensFromState.d.mts +26 -0
- package/lib/hooks/useTokensFromState.js +1 -1
- package/lib/hooks/useTokensFromState.mjs +1 -1
- package/lib/index.d.mts +13 -0
- package/lib/index.js +15 -15
- package/lib/index.mjs +7 -7
- package/lib/provider/afterAuth.d.mts +32 -0
- package/lib/provider/afterAuth.js +5 -5
- package/lib/provider/afterAuth.mjs +4 -4
- package/lib/provider/index.d.mts +42 -0
- package/lib/provider/index.js +9 -9
- package/lib/provider/index.mjs +6 -6
- package/lib/provider/keycloakProvider.d.mts +45 -0
- package/lib/provider/keycloakProvider.js +7 -7
- package/lib/provider/keycloakProvider.mjs +5 -5
- package/lib/provider/keycloakProvider.native.d.mts +32 -0
- package/lib/provider/keycloakProvider.native.js +5 -5
- package/lib/provider/keycloakProvider.native.mjs +4 -4
- package/lib/state/index.d.mts +34 -0
- package/lib/state/index.js +1 -1
- package/lib/state/index.mjs +1 -1
- package/lib/types.d.mts +40 -0
- package/lib/types.js +1 -1
- package/lib/types.mjs +1 -1
- package/lib/util.d.mts +27 -0
- package/lib/util.js +1 -1
- package/lib/util.mjs +1 -1
- package/package.json +27 -27
- /package/lib/{chunk-XXPGZHWZ.js → chunk-KMAXXKJT.js} +0 -0
- /package/lib/{chunk-NHABU752.mjs → chunk-S237YNYQ.mjs} +0 -0
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File: /src/@types/expoKeycloakAuth.d.ts
|
|
3
|
+
* Project: @multiplatform.one/keycloak
|
|
4
|
+
* File Created: 28-11-2022 14:56:57
|
|
5
|
+
* Author: Clay Risser
|
|
6
|
+
* -----
|
|
7
|
+
* Last Modified: 28-11-2022 14:57:43
|
|
8
|
+
* Modified By: Clay Risser
|
|
9
|
+
* -----
|
|
10
|
+
* Risser Labs LLC (c) Copyright 2022
|
|
11
|
+
*
|
|
12
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License.
|
|
14
|
+
* You may obtain a copy of the License at
|
|
15
|
+
*
|
|
16
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
* See the License for the specific language governing permissions and
|
|
22
|
+
* limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
declare module 'expo-keycloak-auth' {
|
|
26
|
+
export function useKeycloak(): any;
|
|
27
|
+
export const KeycloakProvider: any;
|
|
28
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import React__default, { ReactNode, ComponentType } from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* File: /auth/Authenticated.tsx
|
|
5
|
+
* Project: app
|
|
6
|
+
* File Created: 08-11-2022 05:58:23
|
|
7
|
+
* Author: Clay Risser
|
|
8
|
+
* -----
|
|
9
|
+
* Last Modified: 22-11-2022 06:26:38
|
|
10
|
+
* Modified By: Clay Risser
|
|
11
|
+
* -----
|
|
12
|
+
* Risser Labs LLC (c) Copyright 2021 - 2022
|
|
13
|
+
*
|
|
14
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License.
|
|
16
|
+
* You may obtain a copy of the License at
|
|
17
|
+
*
|
|
18
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
*
|
|
20
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
21
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
22
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
|
+
* See the License for the specific language governing permissions and
|
|
24
|
+
* limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
|
|
27
|
+
interface AuthenticatedProps {
|
|
28
|
+
children: ReactNode;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
loggedOutComponent?: ComponentType;
|
|
31
|
+
loginRoute?: string;
|
|
32
|
+
}
|
|
33
|
+
declare function Authenticated({ children, disabled, loginRoute, loggedOutComponent }: AuthenticatedProps): React__default.JSX.Element;
|
|
34
|
+
declare function withAuthenticated<P extends object>(Component: ComponentType<P>): (props: P) => React__default.JSX.Element;
|
|
35
|
+
|
|
36
|
+
export { Authenticated, AuthenticatedProps, withAuthenticated };
|
package/lib/Authenticated.js
CHANGED
|
@@ -2,18 +2,18 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
var
|
|
5
|
+
var _chunkBJ2OPIMWjs = require("./chunk-BJ2OPIMW.js");
|
|
6
6
|
require("./chunk-UBVYEZI3.js");
|
|
7
7
|
require("./chunk-6NDWOV55.js");
|
|
8
8
|
require("./chunk-KLLABHIC.js");
|
|
9
|
-
require("./chunk-
|
|
9
|
+
require("./chunk-HDNHCVXT.js");
|
|
10
10
|
require("./chunk-OYWAYMFN.js");
|
|
11
|
-
require("./chunk-
|
|
11
|
+
require("./chunk-E2X33LSD.js");
|
|
12
12
|
require("./chunk-3ZPHNEJL.js");
|
|
13
13
|
require("./chunk-YGNNHTFE.js");
|
|
14
14
|
require("./chunk-C2FNSVJO.js");
|
|
15
15
|
require("./chunk-A7UBOIAL.js");
|
|
16
16
|
require("./chunk-NWRANDZ6.js");
|
|
17
|
-
require("./chunk-
|
|
18
|
-
exports.Authenticated =
|
|
19
|
-
exports.withAuthenticated =
|
|
17
|
+
require("./chunk-KMAXXKJT.js");
|
|
18
|
+
exports.Authenticated = _chunkBJ2OPIMWjs.Authenticated;
|
|
19
|
+
exports.withAuthenticated = _chunkBJ2OPIMWjs.withAuthenticated;
|
package/lib/Authenticated.mjs
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
Authenticated,
|
|
3
3
|
withAuthenticated
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-ZVG3OFME.mjs";
|
|
5
5
|
import "./chunk-AYKQVWMR.mjs";
|
|
6
6
|
import "./chunk-2GUOEPFY.mjs";
|
|
7
7
|
import "./chunk-NXTVYIBR.mjs";
|
|
8
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-VLUTEDDM.mjs";
|
|
9
9
|
import "./chunk-L5HMOY4M.mjs";
|
|
10
|
-
import "./chunk-
|
|
10
|
+
import "./chunk-NU2SJ3ST.mjs";
|
|
11
11
|
import "./chunk-Y4XMF3R6.mjs";
|
|
12
12
|
import "./chunk-UOKDJT5L.mjs";
|
|
13
13
|
import "./chunk-AD6VPMID.mjs";
|
|
14
14
|
import "./chunk-64PPU7Q3.mjs";
|
|
15
15
|
import "./chunk-7MTPH6XK.mjs";
|
|
16
|
-
import "./chunk-
|
|
16
|
+
import "./chunk-S237YNYQ.mjs";
|
|
17
17
|
export {
|
|
18
18
|
Authenticated,
|
|
19
19
|
withAuthenticated
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import * as React from 'react';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* File: /src/authConfig.ts
|
|
5
|
+
* Project: app
|
|
6
|
+
* File Created: 08-11-2022 09:21:15
|
|
7
|
+
* Author: Clay Risser
|
|
8
|
+
* -----
|
|
9
|
+
* Last Modified: 26-05-2023 08:07:00
|
|
10
|
+
* Modified By: Clay Risser
|
|
11
|
+
* -----
|
|
12
|
+
* Risser Labs LLC (c) Copyright 2021 - 2022
|
|
13
|
+
*
|
|
14
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
15
|
+
* you may not use this file except in compliance with the License.
|
|
16
|
+
* You may obtain a copy of the License at
|
|
17
|
+
*
|
|
18
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
19
|
+
*
|
|
20
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
21
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
22
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
23
|
+
* See the License for the specific language governing permissions and
|
|
24
|
+
* limitations under the License.
|
|
25
|
+
*/
|
|
26
|
+
declare const defaultAuthConfig: AuthConfig;
|
|
27
|
+
declare const AuthConfigContext: React.Context<AuthConfig>;
|
|
28
|
+
interface AuthConfig {
|
|
29
|
+
debug?: boolean;
|
|
30
|
+
ensureFreshness?: boolean;
|
|
31
|
+
loginRoute?: string;
|
|
32
|
+
messageHandlerKeys?: string[];
|
|
33
|
+
persist?: boolean;
|
|
34
|
+
ssr?: boolean;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export { AuthConfig, AuthConfigContext, defaultAuthConfig };
|
package/lib/authConfig.js
CHANGED
|
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
var _chunkA7UBOIALjs = require("./chunk-A7UBOIAL.js");
|
|
6
|
-
require("./chunk-
|
|
6
|
+
require("./chunk-KMAXXKJT.js");
|
|
7
7
|
exports.AuthConfigContext = _chunkA7UBOIALjs.AuthConfigContext;
|
|
8
8
|
exports.defaultAuthConfig = _chunkA7UBOIALjs.defaultAuthConfig;
|
package/lib/authConfig.mjs
CHANGED
|
@@ -36,8 +36,8 @@ function _interopRequireDefault(obj) {
|
|
|
36
36
|
};
|
|
37
37
|
}
|
|
38
38
|
var _chunkKLLABHICjs = require("./chunk-KLLABHIC.js");
|
|
39
|
-
var
|
|
40
|
-
var
|
|
39
|
+
var _chunkHDNHCVXTjs = require("./chunk-HDNHCVXT.js");
|
|
40
|
+
var _chunkE2X33LSDjs = require("./chunk-E2X33LSD.js");
|
|
41
41
|
var _chunk3ZPHNEJLjs = require("./chunk-3ZPHNEJL.js");
|
|
42
42
|
var _chunkYGNNHTFEjs = require("./chunk-YGNNHTFE.js");
|
|
43
43
|
var _chunkC2FNSVJOjs = require("./chunk-C2FNSVJO.js");
|
|
@@ -48,10 +48,10 @@ function Authenticated(param) {
|
|
|
48
48
|
var children = param.children, disabled = param.disabled, loginRoute = param.loginRoute, loggedOutComponent = param.loggedOutComponent;
|
|
49
49
|
var authConfig = _chunk3ZPHNEJLjs.useAuthConfig.call(void 0);
|
|
50
50
|
var authState = _chunkC2FNSVJOjs.useAuthState.call(void 0);
|
|
51
|
-
var login =
|
|
51
|
+
var login = _chunkHDNHCVXTjs.useLogin.call(void 0, loginRoute);
|
|
52
52
|
var tokensFromQuery = _chunkKLLABHICjs.useTokensFromQuery.call(void 0);
|
|
53
53
|
var tokensFromState = _chunkYGNNHTFEjs.useTokensFromState.call(void 0);
|
|
54
|
-
var authenticated =
|
|
54
|
+
var authenticated = _chunkE2X33LSDjs.useKeycloak.call(void 0).authenticated;
|
|
55
55
|
_react.useEffect.call(void 0, function() {
|
|
56
56
|
if (authenticated !== false) return;
|
|
57
57
|
if (authConfig.persist) {
|
|
@@ -122,7 +122,7 @@ function _optionalChain(ops) {
|
|
|
122
122
|
}
|
|
123
123
|
return value;
|
|
124
124
|
}
|
|
125
|
-
var
|
|
125
|
+
var _chunkUBCNCE73js = require("./chunk-UBCNCE73.js");
|
|
126
126
|
var _chunk3ZPHNEJLjs = require("./chunk-3ZPHNEJL.js");
|
|
127
127
|
var _chunkC2FNSVJOjs = require("./chunk-C2FNSVJO.js");
|
|
128
128
|
var _chunkNWRANDZ6js = require("./chunk-NWRANDZ6.js");
|
|
@@ -420,7 +420,7 @@ function KeycloakProvider(param) {
|
|
|
420
420
|
realm: keycloakConfig.realm,
|
|
421
421
|
url: keycloakConfig.url
|
|
422
422
|
}
|
|
423
|
-
}, /* @__PURE__ */ _react2.default.createElement(
|
|
423
|
+
}, /* @__PURE__ */ _react2.default.createElement(_chunkUBCNCE73js.AfterAuth, null, children)));
|
|
424
424
|
}
|
|
425
425
|
if (!keycloak) return /* @__PURE__ */ _react2.default.createElement(LoadingComponent, null);
|
|
426
426
|
return /* @__PURE__ */ _react2.default.createElement(_reactkeycloakweb.ReactKeycloakProvider, {
|
|
@@ -430,7 +430,7 @@ function KeycloakProvider(param) {
|
|
|
430
430
|
initOptions: initOptions,
|
|
431
431
|
onEvent: handleEvent,
|
|
432
432
|
onTokens: onTokens
|
|
433
|
-
}, /* @__PURE__ */ _react2.default.createElement(
|
|
433
|
+
}, /* @__PURE__ */ _react2.default.createElement(_chunkUBCNCE73js.AfterAuth, null, children));
|
|
434
434
|
}
|
|
435
435
|
var defaultKeycloakInitOptions = {
|
|
436
436
|
checkLoginIframe: true,
|
|
@@ -200,7 +200,7 @@ function _optionalChain(ops) {
|
|
|
200
200
|
return value;
|
|
201
201
|
}
|
|
202
202
|
var _chunk3ZPHNEJLjs = require("./chunk-3ZPHNEJL.js");
|
|
203
|
-
var
|
|
203
|
+
var _chunkKMAXXKJTjs = require("./chunk-KMAXXKJT.js");
|
|
204
204
|
// src/hooks/useKeycloak/useKeycloak.ts
|
|
205
205
|
var _multiplatformone = require("multiplatform.one");
|
|
206
206
|
var _reactkeycloakweb = require("@bitspur/react-keycloak-web");
|
|
@@ -241,7 +241,7 @@ var Keycloak = /*#__PURE__*/ function() {
|
|
|
241
241
|
function Keycloak(keycloak, initialized) {
|
|
242
242
|
_class_call_check(this, Keycloak);
|
|
243
243
|
this.keycloak = keycloak;
|
|
244
|
-
|
|
244
|
+
_chunkKMAXXKJTjs.__publicField.call(void 0, this, "authenticated");
|
|
245
245
|
this.authenticated = initialized ? _optionalChain([
|
|
246
246
|
keycloak,
|
|
247
247
|
"optionalAccess",
|
|
@@ -86,7 +86,7 @@ function _interopRequireDefault(obj) {
|
|
|
86
86
|
default: obj
|
|
87
87
|
};
|
|
88
88
|
}
|
|
89
|
-
var
|
|
89
|
+
var _chunkBTCP7NB3js = require("./chunk-BTCP7NB3.js");
|
|
90
90
|
var _chunkKLLABHICjs = require("./chunk-KLLABHIC.js");
|
|
91
91
|
var _chunkYGNNHTFEjs = require("./chunk-YGNNHTFE.js");
|
|
92
92
|
var _chunkA7UBOIALjs = require("./chunk-A7UBOIAL.js");
|
|
@@ -145,7 +145,7 @@ var AuthProvider = function(_param) {
|
|
|
145
145
|
}
|
|
146
146
|
return /* @__PURE__ */ _react2.default.createElement(_chunkA7UBOIALjs.AuthConfigContext.Provider, {
|
|
147
147
|
value: authConfig
|
|
148
|
-
}, /* @__PURE__ */ _react2.default.createElement(
|
|
148
|
+
}, /* @__PURE__ */ _react2.default.createElement(_chunkBTCP7NB3js.KeycloakProvider, {
|
|
149
149
|
cookies: cookies,
|
|
150
150
|
keycloakConfig: {
|
|
151
151
|
realm: realm || "main",
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
var _chunkOYWAYMFNjs = require("./chunk-OYWAYMFN.js");
|
|
6
|
-
var
|
|
6
|
+
var _chunkE2X33LSDjs = require("./chunk-E2X33LSD.js");
|
|
7
7
|
var _chunk3ZPHNEJLjs = require("./chunk-3ZPHNEJL.js");
|
|
8
8
|
// src/hooks/useLogin.ts
|
|
9
9
|
var _multiplatformone = require("multiplatform.one");
|
|
@@ -12,7 +12,7 @@ function useLogin(loginRoute) {
|
|
|
12
12
|
if (_multiplatformone.MultiPlatform.isStorybook) return function() {
|
|
13
13
|
return null;
|
|
14
14
|
};
|
|
15
|
-
var keycloak =
|
|
15
|
+
var keycloak = _chunkE2X33LSDjs.useKeycloak.call(void 0);
|
|
16
16
|
var authConfig = _chunk3ZPHNEJLjs.useAuthConfig.call(void 0);
|
|
17
17
|
var currentRouteName = _chunkOYWAYMFNjs.useCurrentRouteName.call(void 0);
|
|
18
18
|
var router = _router.useRouter.call(void 0);
|
|
@@ -7,7 +7,7 @@ function _interopRequireDefault(obj) {
|
|
|
7
7
|
default: obj
|
|
8
8
|
};
|
|
9
9
|
}
|
|
10
|
-
var
|
|
10
|
+
var _chunkE2X33LSDjs = require("./chunk-E2X33LSD.js");
|
|
11
11
|
var _chunk3ZPHNEJLjs = require("./chunk-3ZPHNEJL.js");
|
|
12
12
|
var _chunkC2FNSVJOjs = require("./chunk-C2FNSVJO.js");
|
|
13
13
|
// src/provider/afterAuth.tsx
|
|
@@ -18,7 +18,7 @@ var AfterAuth = function(param) {
|
|
|
18
18
|
var children = param.children;
|
|
19
19
|
var authConfig = _chunk3ZPHNEJLjs.useAuthConfig.call(void 0);
|
|
20
20
|
var authState = _chunkC2FNSVJOjs.useAuthState.call(void 0);
|
|
21
|
-
var
|
|
21
|
+
var _chunkE2X33LSDjs_useKeycloak_call = _chunkE2X33LSDjs.useKeycloak.call(void 0), token = _chunkE2X33LSDjs_useKeycloak_call.token, refreshToken = _chunkE2X33LSDjs_useKeycloak_call.refreshToken, authenticated = _chunkE2X33LSDjs_useKeycloak_call.authenticated, idToken = _chunkE2X33LSDjs_useKeycloak_call.idToken;
|
|
22
22
|
_react.useEffect.call(void 0, function() {
|
|
23
23
|
if (!authenticated) return;
|
|
24
24
|
if (authConfig.persist && token) {
|
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
} from "./chunk-NXTVYIBR.mjs";
|
|
4
4
|
import {
|
|
5
5
|
useLogin
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VLUTEDDM.mjs";
|
|
7
7
|
import {
|
|
8
8
|
useKeycloak
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NU2SJ3ST.mjs";
|
|
10
10
|
import {
|
|
11
11
|
useAuthConfig
|
|
12
12
|
} from "./chunk-Y4XMF3R6.mjs";
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { useAuthConfig } from './useAuthConfig.mjs';
|
|
2
|
+
export { useCurrentRouteName } from './useCurrentRouteName/index.mjs';
|
|
3
|
+
export { IKeycloak, ITokenParsed, Keycloak, useKeycloak } from './useKeycloak/index.mjs';
|
|
4
|
+
export { useLogin } from './useLogin.mjs';
|
|
5
|
+
export { useTokensFromQuery } from './useTokensFromQuery/index.mjs';
|
|
6
|
+
export { useTokensFromState } from './useTokensFromState.mjs';
|
|
7
|
+
import '../authConfig.mjs';
|
|
8
|
+
import 'react';
|
|
9
|
+
import '@bitspur/keycloak-js';
|
package/lib/hooks/index.js
CHANGED
|
@@ -5,19 +5,19 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
require("../chunk-UBVYEZI3.js");
|
|
6
6
|
require("../chunk-6NDWOV55.js");
|
|
7
7
|
var _chunkKLLABHICjs = require("../chunk-KLLABHIC.js");
|
|
8
|
-
var
|
|
8
|
+
var _chunkHDNHCVXTjs = require("../chunk-HDNHCVXT.js");
|
|
9
9
|
var _chunkOYWAYMFNjs = require("../chunk-OYWAYMFN.js");
|
|
10
|
-
var
|
|
10
|
+
var _chunkE2X33LSDjs = require("../chunk-E2X33LSD.js");
|
|
11
11
|
var _chunk3ZPHNEJLjs = require("../chunk-3ZPHNEJL.js");
|
|
12
12
|
var _chunkYGNNHTFEjs = require("../chunk-YGNNHTFE.js");
|
|
13
13
|
require("../chunk-C2FNSVJO.js");
|
|
14
14
|
require("../chunk-A7UBOIAL.js");
|
|
15
15
|
require("../chunk-NWRANDZ6.js");
|
|
16
|
-
require("../chunk-
|
|
17
|
-
exports.Keycloak =
|
|
16
|
+
require("../chunk-KMAXXKJT.js");
|
|
17
|
+
exports.Keycloak = _chunkE2X33LSDjs.Keycloak;
|
|
18
18
|
exports.useAuthConfig = _chunk3ZPHNEJLjs.useAuthConfig;
|
|
19
19
|
exports.useCurrentRouteName = _chunkOYWAYMFNjs.useCurrentRouteName;
|
|
20
|
-
exports.useKeycloak =
|
|
21
|
-
exports.useLogin =
|
|
20
|
+
exports.useKeycloak = _chunkE2X33LSDjs.useKeycloak;
|
|
21
|
+
exports.useLogin = _chunkHDNHCVXTjs.useLogin;
|
|
22
22
|
exports.useTokensFromQuery = _chunkKLLABHICjs.useTokensFromQuery;
|
|
23
23
|
exports.useTokensFromState = _chunkYGNNHTFEjs.useTokensFromState;
|
package/lib/hooks/index.mjs
CHANGED
|
@@ -5,14 +5,14 @@ import {
|
|
|
5
5
|
} from "../chunk-NXTVYIBR.mjs";
|
|
6
6
|
import {
|
|
7
7
|
useLogin
|
|
8
|
-
} from "../chunk-
|
|
8
|
+
} from "../chunk-VLUTEDDM.mjs";
|
|
9
9
|
import {
|
|
10
10
|
useCurrentRouteName
|
|
11
11
|
} from "../chunk-L5HMOY4M.mjs";
|
|
12
12
|
import {
|
|
13
13
|
Keycloak,
|
|
14
14
|
useKeycloak
|
|
15
|
-
} from "../chunk-
|
|
15
|
+
} from "../chunk-NU2SJ3ST.mjs";
|
|
16
16
|
import {
|
|
17
17
|
useAuthConfig
|
|
18
18
|
} from "../chunk-Y4XMF3R6.mjs";
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import "../chunk-AD6VPMID.mjs";
|
|
23
23
|
import "../chunk-64PPU7Q3.mjs";
|
|
24
24
|
import "../chunk-7MTPH6XK.mjs";
|
|
25
|
-
import "../chunk-
|
|
25
|
+
import "../chunk-S237YNYQ.mjs";
|
|
26
26
|
export {
|
|
27
27
|
Keycloak,
|
|
28
28
|
useAuthConfig,
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { AuthConfig } from '../authConfig.mjs';
|
|
2
|
+
import 'react';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* File: /src/hooks/useAuthConfig.ts
|
|
6
|
+
* Project: app
|
|
7
|
+
* File Created: 08-11-2022 09:20:41
|
|
8
|
+
* Author: Clay Risser
|
|
9
|
+
* -----
|
|
10
|
+
* Last Modified: 25-11-2022 09:52:31
|
|
11
|
+
* Modified By: Clay Risser
|
|
12
|
+
* -----
|
|
13
|
+
* Risser Labs LLC (c) Copyright 2021 - 2022
|
|
14
|
+
*
|
|
15
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
16
|
+
* you may not use this file except in compliance with the License.
|
|
17
|
+
* You may obtain a copy of the License at
|
|
18
|
+
*
|
|
19
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
20
|
+
*
|
|
21
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
22
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
23
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
24
|
+
* See the License for the specific language governing permissions and
|
|
25
|
+
* limitations under the License.
|
|
26
|
+
*/
|
|
27
|
+
declare function useAuthConfig(): AuthConfig;
|
|
28
|
+
|
|
29
|
+
export { useAuthConfig };
|
|
@@ -4,5 +4,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
});
|
|
5
5
|
var _chunk3ZPHNEJLjs = require("../chunk-3ZPHNEJL.js");
|
|
6
6
|
require("../chunk-A7UBOIAL.js");
|
|
7
|
-
require("../chunk-
|
|
7
|
+
require("../chunk-KMAXXKJT.js");
|
|
8
8
|
exports.useAuthConfig = _chunk3ZPHNEJLjs.useAuthConfig;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File: /src/hooks/useCurrentRouteName/index.ts
|
|
3
|
+
* Project: @multiplatform.one/keycloak
|
|
4
|
+
* File Created: 24-02-2023 06:30:32
|
|
5
|
+
* Author: Clay Risser
|
|
6
|
+
* -----
|
|
7
|
+
* Last Modified: 24-02-2023 06:30:54
|
|
8
|
+
* Modified By: Clay Risser
|
|
9
|
+
* -----
|
|
10
|
+
* Risser Labs LLC (c) Copyright 2022 - 2023
|
|
11
|
+
*
|
|
12
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License.
|
|
14
|
+
* You may obtain a copy of the License at
|
|
15
|
+
*
|
|
16
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
* See the License for the specific language governing permissions and
|
|
22
|
+
* limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
declare function useCurrentRouteName(): string | null;
|
|
25
|
+
|
|
26
|
+
export { useCurrentRouteName };
|
|
@@ -3,5 +3,5 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
5
|
var _chunkOYWAYMFNjs = require("../../chunk-OYWAYMFN.js");
|
|
6
|
-
require("../../chunk-
|
|
6
|
+
require("../../chunk-KMAXXKJT.js");
|
|
7
7
|
exports.useCurrentRouteName = _chunkOYWAYMFNjs.useCurrentRouteName;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File: /src/hooks/useCurrentRouteName/index.native.ts
|
|
3
|
+
* Project: @multiplatform.one/keycloak
|
|
4
|
+
* File Created: 24-02-2023 06:30:36
|
|
5
|
+
* Author: Clay Risser
|
|
6
|
+
* -----
|
|
7
|
+
* Last Modified: 24-02-2023 06:31:25
|
|
8
|
+
* Modified By: Clay Risser
|
|
9
|
+
* -----
|
|
10
|
+
* Risser Labs LLC (c) Copyright 2022 - 2023
|
|
11
|
+
*
|
|
12
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
13
|
+
* you may not use this file except in compliance with the License.
|
|
14
|
+
* You may obtain a copy of the License at
|
|
15
|
+
*
|
|
16
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
17
|
+
*
|
|
18
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
19
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
20
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
21
|
+
* See the License for the specific language governing permissions and
|
|
22
|
+
* limitations under the License.
|
|
23
|
+
*/
|
|
24
|
+
declare function useCurrentRouteName(): string | null;
|
|
25
|
+
|
|
26
|
+
export { useCurrentRouteName };
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", {
|
|
3
3
|
value: true
|
|
4
4
|
});
|
|
5
|
-
require("../../chunk-
|
|
5
|
+
require("../../chunk-KMAXXKJT.js");
|
|
6
6
|
// src/hooks/useCurrentRouteName/index.native.ts
|
|
7
7
|
var _multiplatformone = require("multiplatform.one");
|
|
8
8
|
var _native = require("@react-navigation/native");
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import * as _bitspur_keycloak_js from '@bitspur/keycloak-js';
|
|
2
|
+
import { KeycloakRoles, KeycloakTokenParsed, KeycloakResourceAccess } from '@bitspur/keycloak-js';
|
|
3
|
+
|
|
4
|
+
declare function useKeycloak(): Keycloak;
|
|
5
|
+
declare class Keycloak implements IKeycloak {
|
|
6
|
+
private readonly keycloak;
|
|
7
|
+
authenticated?: boolean;
|
|
8
|
+
constructor(keycloak: IKeycloak | undefined, initialized: boolean);
|
|
9
|
+
get idToken(): string | undefined;
|
|
10
|
+
get realmAccess(): _bitspur_keycloak_js.KeycloakRoles | undefined;
|
|
11
|
+
get refreshToken(): string | undefined;
|
|
12
|
+
get refreshTokenParsed(): _bitspur_keycloak_js.KeycloakTokenParsed | undefined;
|
|
13
|
+
get resourceAccess(): _bitspur_keycloak_js.KeycloakResourceAccess | undefined;
|
|
14
|
+
get subject(): string | undefined;
|
|
15
|
+
get token(): string | undefined;
|
|
16
|
+
get tokenParsed(): ITokenParsed | undefined;
|
|
17
|
+
get email(): any;
|
|
18
|
+
get username(): string | undefined;
|
|
19
|
+
login(): Promise<unknown>;
|
|
20
|
+
logout(): Promise<unknown>;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* File: /src/hooks/useKeycloak/index.ts
|
|
25
|
+
* Project: app
|
|
26
|
+
* File Created: 08-11-2022 14:10:44
|
|
27
|
+
* Author: Clay Risser
|
|
28
|
+
* -----
|
|
29
|
+
* Last Modified: 01-06-2023 13:55:42
|
|
30
|
+
* Modified By: Clay Risser
|
|
31
|
+
* -----
|
|
32
|
+
* Risser Labs LLC (c) Copyright 2021 - 2022
|
|
33
|
+
*
|
|
34
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
35
|
+
* you may not use this file except in compliance with the License.
|
|
36
|
+
* You may obtain a copy of the License at
|
|
37
|
+
*
|
|
38
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
39
|
+
*
|
|
40
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
41
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
42
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
43
|
+
* See the License for the specific language governing permissions and
|
|
44
|
+
* limitations under the License.
|
|
45
|
+
*/
|
|
46
|
+
|
|
47
|
+
interface IKeycloak {
|
|
48
|
+
authenticated?: boolean;
|
|
49
|
+
idToken?: string;
|
|
50
|
+
realmAccess?: KeycloakRoles;
|
|
51
|
+
refreshToken?: string;
|
|
52
|
+
refreshTokenParsed?: KeycloakTokenParsed;
|
|
53
|
+
resourceAccess?: KeycloakResourceAccess;
|
|
54
|
+
subject?: string;
|
|
55
|
+
token?: string;
|
|
56
|
+
tokenParsed?: ITokenParsed;
|
|
57
|
+
email?: string;
|
|
58
|
+
username?: string;
|
|
59
|
+
login: () => Promise<unknown>;
|
|
60
|
+
logout: () => Promise<unknown>;
|
|
61
|
+
}
|
|
62
|
+
interface ITokenParsed extends KeycloakTokenParsed {
|
|
63
|
+
'allowed-origins'?: string[];
|
|
64
|
+
email_verified?: boolean;
|
|
65
|
+
preferred_username?: string;
|
|
66
|
+
scope?: string;
|
|
67
|
+
sid?: string;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
export { IKeycloak, ITokenParsed, Keycloak, useKeycloak };
|