@multiplatform.one/keycloak 0.3.32 → 0.7.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/lib/index.js +34 -0
- package/package.json +32 -48
- package/src/@types/coreJsPure.d.ts +8 -8
- package/src/hooks/useKeycloak/index.ts +3 -4
- package/src/hooks/useKeycloak/useKeycloak.native.ts +3 -3
- package/src/hooks/useKeycloak/useKeycloak.ts +71 -16
- package/dist/esm/Authenticated.mjs +0 -40
- package/dist/esm/Authenticated.mjs.map +0 -7
- package/dist/esm/authConfig.mjs +0 -12
- package/dist/esm/authConfig.mjs.map +0 -7
- package/dist/esm/hooks/index.mjs +0 -7
- package/dist/esm/hooks/index.mjs.map +0 -7
- package/dist/esm/hooks/useAuthConfig.mjs +0 -9
- package/dist/esm/hooks/useAuthConfig.mjs.map +0 -7
- package/dist/esm/hooks/useCurrentRouteName/index.mjs +0 -17
- package/dist/esm/hooks/useCurrentRouteName/index.mjs.map +0 -7
- package/dist/esm/hooks/useCurrentRouteName/index.native.mjs +0 -12
- package/dist/esm/hooks/useCurrentRouteName/index.native.mjs.map +0 -7
- package/dist/esm/hooks/useKeycloak/index.mjs +0 -2
- package/dist/esm/hooks/useKeycloak/index.mjs.map +0 -7
- package/dist/esm/hooks/useKeycloak/useKeycloak.mjs +0 -91
- package/dist/esm/hooks/useKeycloak/useKeycloak.mjs.map +0 -7
- package/dist/esm/hooks/useKeycloak/useKeycloak.native.mjs +0 -108
- package/dist/esm/hooks/useKeycloak/useKeycloak.native.mjs.map +0 -7
- package/dist/esm/hooks/useLogin.mjs +0 -35
- package/dist/esm/hooks/useLogin.mjs.map +0 -7
- package/dist/esm/hooks/useTokensFromQuery/index.mjs +0 -12
- package/dist/esm/hooks/useTokensFromQuery/index.mjs.map +0 -7
- package/dist/esm/hooks/useTokensFromQuery/index.native.mjs +0 -7
- package/dist/esm/hooks/useTokensFromQuery/index.native.mjs.map +0 -7
- package/dist/esm/hooks/useTokensFromState.mjs +0 -10
- package/dist/esm/hooks/useTokensFromState.mjs.map +0 -7
- package/dist/esm/index.mjs +0 -5
- package/dist/esm/index.mjs.map +0 -7
- package/dist/esm/provider/afterAuth.mjs +0 -43
- package/dist/esm/provider/afterAuth.mjs.map +0 -7
- package/dist/esm/provider/index.mjs +0 -136
- package/dist/esm/provider/index.mjs.map +0 -7
- package/dist/esm/provider/keycloakProvider.mjs +0 -338
- package/dist/esm/provider/keycloakProvider.mjs.map +0 -7
- package/dist/esm/provider/keycloakProvider.native.mjs +0 -69
- package/dist/esm/provider/keycloakProvider.native.mjs.map +0 -7
- package/dist/esm/state/index.mjs +0 -16
- package/dist/esm/state/index.mjs.map +0 -7
- package/dist/esm/types.mjs +0 -5
- package/dist/esm/types.mjs.map +0 -7
- package/dist/esm/util.mjs +0 -26
- package/dist/esm/util.mjs.map +0 -7
- package/dist/jsx/Authenticated.mjs +0 -35
- package/dist/jsx/Authenticated.mjs.map +0 -7
- package/dist/jsx/authConfig.mjs +0 -12
- package/dist/jsx/authConfig.mjs.map +0 -7
- package/dist/jsx/hooks/index.mjs +0 -7
- package/dist/jsx/hooks/index.mjs.map +0 -7
- package/dist/jsx/hooks/useAuthConfig.mjs +0 -9
- package/dist/jsx/hooks/useAuthConfig.mjs.map +0 -7
- package/dist/jsx/hooks/useCurrentRouteName/index.mjs +0 -17
- package/dist/jsx/hooks/useCurrentRouteName/index.mjs.map +0 -7
- package/dist/jsx/hooks/useCurrentRouteName/index.native.mjs +0 -12
- package/dist/jsx/hooks/useCurrentRouteName/index.native.mjs.map +0 -7
- package/dist/jsx/hooks/useKeycloak/index.mjs +0 -2
- package/dist/jsx/hooks/useKeycloak/index.mjs.map +0 -7
- package/dist/jsx/hooks/useKeycloak/useKeycloak.mjs +0 -32
- package/dist/jsx/hooks/useKeycloak/useKeycloak.mjs.map +0 -7
- package/dist/jsx/hooks/useKeycloak/useKeycloak.native.mjs +0 -58
- package/dist/jsx/hooks/useKeycloak/useKeycloak.native.mjs.map +0 -7
- package/dist/jsx/hooks/useLogin.mjs +0 -33
- package/dist/jsx/hooks/useLogin.mjs.map +0 -7
- package/dist/jsx/hooks/useTokensFromQuery/index.mjs +0 -10
- package/dist/jsx/hooks/useTokensFromQuery/index.mjs.map +0 -7
- package/dist/jsx/hooks/useTokensFromQuery/index.native.mjs +0 -5
- package/dist/jsx/hooks/useTokensFromQuery/index.native.mjs.map +0 -7
- package/dist/jsx/hooks/useTokensFromState.mjs +0 -10
- package/dist/jsx/hooks/useTokensFromState.mjs.map +0 -7
- package/dist/jsx/index.mjs +0 -5
- package/dist/jsx/index.mjs.map +0 -7
- package/dist/jsx/provider/afterAuth.mjs +0 -42
- package/dist/jsx/provider/afterAuth.mjs.map +0 -7
- package/dist/jsx/provider/index.mjs +0 -61
- package/dist/jsx/provider/index.mjs.map +0 -7
- package/dist/jsx/provider/keycloakProvider.mjs +0 -247
- package/dist/jsx/provider/keycloakProvider.mjs.map +0 -7
- package/dist/jsx/provider/keycloakProvider.native.mjs +0 -14
- package/dist/jsx/provider/keycloakProvider.native.mjs.map +0 -7
- package/dist/jsx/state/index.mjs +0 -19
- package/dist/jsx/state/index.mjs.map +0 -7
- package/dist/jsx/types.mjs +0 -5
- package/dist/jsx/types.mjs.map +0 -7
- package/dist/jsx/util.mjs +0 -25
- package/dist/jsx/util.mjs.map +0 -7
- package/dist/lib/Authenticated.d.ts +0 -32
- package/dist/lib/Authenticated.js +0 -75
- package/dist/lib/Authenticated.js.map +0 -7
- package/dist/lib/authConfig.d.ts +0 -34
- package/dist/lib/authConfig.js +0 -37
- package/dist/lib/authConfig.js.map +0 -7
- package/dist/lib/hooks/index.d.ts +0 -29
- package/dist/lib/hooks/index.js +0 -33
- package/dist/lib/hooks/index.js.map +0 -7
- package/dist/lib/hooks/useAuthConfig.d.ts +0 -24
- package/dist/lib/hooks/useAuthConfig.js +0 -33
- package/dist/lib/hooks/useAuthConfig.js.map +0 -7
- package/dist/lib/hooks/useCurrentRouteName/index.d.ts +0 -24
- package/dist/lib/hooks/useCurrentRouteName/index.js +0 -41
- package/dist/lib/hooks/useCurrentRouteName/index.js.map +0 -7
- package/dist/lib/hooks/useCurrentRouteName/index.native.d.ts +0 -24
- package/dist/lib/hooks/useCurrentRouteName/index.native.js +0 -36
- package/dist/lib/hooks/useCurrentRouteName/index.native.js.map +0 -7
- package/dist/lib/hooks/useKeycloak/index.d.ts +0 -48
- package/dist/lib/hooks/useKeycloak/index.js +0 -23
- package/dist/lib/hooks/useKeycloak/index.js.map +0 -7
- package/dist/lib/hooks/useKeycloak/useKeycloak.d.ts +0 -25
- package/dist/lib/hooks/useKeycloak/useKeycloak.js +0 -72
- package/dist/lib/hooks/useKeycloak/useKeycloak.js.map +0 -7
- package/dist/lib/hooks/useKeycloak/useKeycloak.native.d.ts +0 -40
- package/dist/lib/hooks/useKeycloak/useKeycloak.native.js +0 -93
- package/dist/lib/hooks/useKeycloak/useKeycloak.native.js.map +0 -7
- package/dist/lib/hooks/useLogin.d.ts +0 -24
- package/dist/lib/hooks/useLogin.js +0 -57
- package/dist/lib/hooks/useLogin.js.map +0 -7
- package/dist/lib/hooks/useTokensFromQuery/index.d.ts +0 -24
- package/dist/lib/hooks/useTokensFromQuery/index.js +0 -34
- package/dist/lib/hooks/useTokensFromQuery/index.js.map +0 -7
- package/dist/lib/hooks/useTokensFromQuery/index.native.d.ts +0 -24
- package/dist/lib/hooks/useTokensFromQuery/index.native.js +0 -29
- package/dist/lib/hooks/useTokensFromQuery/index.native.js.map +0 -7
- package/dist/lib/hooks/useTokensFromState.d.ts +0 -24
- package/dist/lib/hooks/useTokensFromState.js +0 -34
- package/dist/lib/hooks/useTokensFromState.js.map +0 -7
- package/dist/lib/index.d.ts +0 -27
- package/dist/lib/index.js +0 -29
- package/dist/lib/index.js.map +0 -7
- package/dist/lib/provider/afterAuth.d.ts +0 -28
- package/dist/lib/provider/afterAuth.js +0 -67
- package/dist/lib/provider/afterAuth.js.map +0 -7
- package/dist/lib/provider/index.d.ts +0 -38
- package/dist/lib/provider/index.js +0 -131
- package/dist/lib/provider/index.js.map +0 -7
- package/dist/lib/provider/keycloakProvider.d.ts +0 -41
- package/dist/lib/provider/keycloakProvider.js +0 -305
- package/dist/lib/provider/keycloakProvider.js.map +0 -7
- package/dist/lib/provider/keycloakProvider.native.d.ts +0 -26
- package/dist/lib/provider/keycloakProvider.native.js +0 -55
- package/dist/lib/provider/keycloakProvider.native.js.map +0 -7
- package/dist/lib/state/index.d.ts +0 -24
- package/dist/lib/state/index.js +0 -43
- package/dist/lib/state/index.js.map +0 -7
- package/dist/lib/tsconfig.build.tsbuildinfo +0 -1
- package/dist/lib/types.d.ts +0 -39
- package/dist/lib/types.js +0 -25
- package/dist/lib/types.js.map +0 -7
- package/dist/lib/util.d.ts +0 -25
- package/dist/lib/util.js +0 -51
- package/dist/lib/util.js.map +0 -7
package/dist/lib/hooks/index.js
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var hooks_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(hooks_exports);
|
|
18
|
-
__reExport(hooks_exports, require("./useAuthConfig"), module.exports);
|
|
19
|
-
__reExport(hooks_exports, require("./useCurrentRouteName"), module.exports);
|
|
20
|
-
__reExport(hooks_exports, require("./useKeycloak"), module.exports);
|
|
21
|
-
__reExport(hooks_exports, require("./useLogin"), module.exports);
|
|
22
|
-
__reExport(hooks_exports, require("./useTokensFromQuery"), module.exports);
|
|
23
|
-
__reExport(hooks_exports, require("./useTokensFromState"), module.exports);
|
|
24
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
25
|
-
0 && (module.exports = {
|
|
26
|
-
...require("./useAuthConfig"),
|
|
27
|
-
...require("./useCurrentRouteName"),
|
|
28
|
-
...require("./useKeycloak"),
|
|
29
|
-
...require("./useLogin"),
|
|
30
|
-
...require("./useTokensFromQuery"),
|
|
31
|
-
...require("./useTokensFromState")
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * File: /src/hooks/index.ts\n * Project: app\n * File Created: 08-11-2022 06:34:56\n * Author: Clay Risser\n * -----\n * Last Modified: 26-05-2023 07:00:31\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport * from './useAuthConfig';\nexport * from './useCurrentRouteName';\nexport * from './useKeycloak';\nexport * from './useLogin';\nexport * from './useTokensFromQuery';\nexport * from './useTokensFromState';\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAwBA,0BAAc,4BAxBd;AAyBA,0BAAc,kCAzBd;AA0BA,0BAAc,0BA1Bd;AA2BA,0BAAc,uBA3Bd;AA4BA,0BAAc,iCA5Bd;AA6BA,0BAAc,iCA7Bd;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File: /src/hooks/useAuthConfig.ts
|
|
3
|
-
* Project: app
|
|
4
|
-
* File Created: 08-11-2022 09:20:41
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* Last Modified: 25-11-2022 09:52:31
|
|
8
|
-
* Modified By: Clay Risser
|
|
9
|
-
* -----
|
|
10
|
-
* Risser Labs LLC (c) Copyright 2021 - 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
|
-
export declare function useAuthConfig(): import("../authConfig").AuthConfig;
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var useAuthConfig_exports = {};
|
|
20
|
-
__export(useAuthConfig_exports, {
|
|
21
|
-
useAuthConfig: () => useAuthConfig
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(useAuthConfig_exports);
|
|
24
|
-
var import_react = require("react");
|
|
25
|
-
var import_authConfig = require("../authConfig");
|
|
26
|
-
function useAuthConfig() {
|
|
27
|
-
return (0, import_react.useContext)(import_authConfig.AuthConfigContext);
|
|
28
|
-
}
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
useAuthConfig
|
|
32
|
-
});
|
|
33
|
-
//# sourceMappingURL=useAuthConfig.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/hooks/useAuthConfig.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * File: /src/hooks/useAuthConfig.ts\n * Project: app\n * File Created: 08-11-2022 09:20:41\n * Author: Clay Risser\n * -----\n * Last Modified: 25-11-2022 09:52:31\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { useContext } from 'react';\nimport { AuthConfigContext } from '../authConfig';\n\nexport function useAuthConfig() {\n return useContext(AuthConfigContext);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBA,mBAA2B;AAC3B,wBAAkC;AAE3B,SAAS,gBAAgB;AAC9B,aAAO,yBAAW,mCAAiB;AACrC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
export declare function useCurrentRouteName(): string | null;
|
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var useCurrentRouteName_exports = {};
|
|
20
|
-
__export(useCurrentRouteName_exports, {
|
|
21
|
-
useCurrentRouteName: () => useCurrentRouteName
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(useCurrentRouteName_exports);
|
|
24
|
-
var import_multiplatform = require("multiplatform.one");
|
|
25
|
-
var import_native = require("@react-navigation/native");
|
|
26
|
-
var import_router = require("next/router");
|
|
27
|
-
function useCurrentRouteName() {
|
|
28
|
-
if (import_multiplatform.MultiPlatform.isStorybook)
|
|
29
|
-
return null;
|
|
30
|
-
if (import_multiplatform.MultiPlatform.isNext) {
|
|
31
|
-
const router = (0, import_router.useRouter)();
|
|
32
|
-
return router.route;
|
|
33
|
-
}
|
|
34
|
-
const route = (0, import_native.useRoute)();
|
|
35
|
-
return route.name;
|
|
36
|
-
}
|
|
37
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
38
|
-
0 && (module.exports = {
|
|
39
|
-
useCurrentRouteName
|
|
40
|
-
});
|
|
41
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/hooks/useCurrentRouteName/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * File: /src/hooks/useCurrentRouteName/index.ts\n * Project: @multiplatform.one/keycloak\n * File Created: 24-02-2023 06:30:32\n * Author: Clay Risser\n * -----\n * Last Modified: 24-02-2023 06:30:54\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2022 - 2023\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MultiPlatform } from 'multiplatform.one';\nimport { useRoute } from '@react-navigation/native';\nimport { useRouter } from 'next/router';\n\nexport function useCurrentRouteName() {\n if (MultiPlatform.isStorybook) return null;\n if (MultiPlatform.isNext) {\n const router = useRouter();\n return router.route;\n }\n const route = useRoute();\n return route.name;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBA,2BAA8B;AAC9B,oBAAyB;AACzB,oBAA0B;AAEnB,SAAS,sBAAsB;AACpC,MAAI,mCAAc;AAAa,WAAO;AACtC,MAAI,mCAAc,QAAQ;AACxB,UAAM,aAAS,yBAAU;AACzB,WAAO,OAAO;AAAA,EAChB;AACA,QAAM,YAAQ,wBAAS;AACvB,SAAO,MAAM;AACf;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
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
|
-
export declare function useCurrentRouteName(): string | null;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
-
};
|
|
10
|
-
var __copyProps = (to, from, except, desc) => {
|
|
11
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
-
for (let key of __getOwnPropNames(from))
|
|
13
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
-
}
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
-
var index_native_exports = {};
|
|
20
|
-
__export(index_native_exports, {
|
|
21
|
-
useCurrentRouteName: () => useCurrentRouteName
|
|
22
|
-
});
|
|
23
|
-
module.exports = __toCommonJS(index_native_exports);
|
|
24
|
-
var import_multiplatform = require("multiplatform.one");
|
|
25
|
-
var import_native = require("@react-navigation/native");
|
|
26
|
-
function useCurrentRouteName() {
|
|
27
|
-
if (import_multiplatform.MultiPlatform.isStorybook)
|
|
28
|
-
return null;
|
|
29
|
-
const route = (0, import_native.useRoute)();
|
|
30
|
-
return route.name;
|
|
31
|
-
}
|
|
32
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
33
|
-
0 && (module.exports = {
|
|
34
|
-
useCurrentRouteName
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=index.native.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/hooks/useCurrentRouteName/index.native.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * File: /src/hooks/useCurrentRouteName/index.native.ts\n * Project: @multiplatform.one/keycloak\n * File Created: 24-02-2023 06:30:36\n * Author: Clay Risser\n * -----\n * Last Modified: 24-02-2023 06:31:25\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2022 - 2023\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { MultiPlatform } from 'multiplatform.one';\nimport { useRoute } from '@react-navigation/native';\n\nexport function useCurrentRouteName() {\n if (MultiPlatform.isStorybook) return null;\n const route = useRoute();\n return route.name;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBA,2BAA8B;AAC9B,oBAAyB;AAElB,SAAS,sBAAsB;AACpC,MAAI,mCAAc;AAAa,WAAO;AACtC,QAAM,YAAQ,wBAAS;AACvB,SAAO,MAAM;AACf;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File: /src/hooks/useKeycloak/index.ts
|
|
3
|
-
* Project: app
|
|
4
|
-
* File Created: 08-11-2022 14:10:44
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* Last Modified: 31-05-2023 12:41:37
|
|
8
|
-
* Modified By: Clay Risser
|
|
9
|
-
* -----
|
|
10
|
-
* Risser Labs LLC (c) Copyright 2021 - 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
|
-
import type { KeycloakResourceAccess, KeycloakRoles, KeycloakTokenParsed } from '@bitspur/keycloak-js';
|
|
25
|
-
export * from './useKeycloak';
|
|
26
|
-
export interface IKeycloak {
|
|
27
|
-
authenticated?: boolean;
|
|
28
|
-
idToken?: string;
|
|
29
|
-
realmAccess?: KeycloakRoles;
|
|
30
|
-
refreshToken?: string;
|
|
31
|
-
refreshTokenParsed?: KeycloakTokenParsed;
|
|
32
|
-
resourceAccess?: KeycloakResourceAccess;
|
|
33
|
-
subject?: string;
|
|
34
|
-
token?: string;
|
|
35
|
-
tokenParsed?: ITokenParsed;
|
|
36
|
-
email?: string;
|
|
37
|
-
username?: string;
|
|
38
|
-
userId?: string;
|
|
39
|
-
login: () => Promise<unknown> | unknown;
|
|
40
|
-
logout: () => Promise<unknown> | unknown;
|
|
41
|
-
}
|
|
42
|
-
export interface ITokenParsed extends KeycloakTokenParsed {
|
|
43
|
-
'allowed-origins'?: string[];
|
|
44
|
-
email_verified?: boolean;
|
|
45
|
-
preferred_username?: string;
|
|
46
|
-
scope?: string;
|
|
47
|
-
sid?: string;
|
|
48
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __copyProps = (to, from, except, desc) => {
|
|
7
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
-
for (let key of __getOwnPropNames(from))
|
|
9
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
-
}
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
-
var useKeycloak_exports = {};
|
|
17
|
-
module.exports = __toCommonJS(useKeycloak_exports);
|
|
18
|
-
__reExport(useKeycloak_exports, require("./useKeycloak"), module.exports);
|
|
19
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
20
|
-
0 && (module.exports = {
|
|
21
|
-
...require("./useKeycloak")
|
|
22
|
-
});
|
|
23
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/hooks/useKeycloak/index.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * File: /src/hooks/useKeycloak/index.ts\n * Project: app\n * File Created: 08-11-2022 14:10:44\n * Author: Clay Risser\n * -----\n * Last Modified: 31-05-2023 12:41:37\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { KeycloakResourceAccess, KeycloakRoles, KeycloakTokenParsed } from '@bitspur/keycloak-js';\nexport * from './useKeycloak';\n\nexport interface IKeycloak {\n authenticated?: boolean;\n idToken?: string;\n realmAccess?: KeycloakRoles;\n refreshToken?: string;\n refreshTokenParsed?: KeycloakTokenParsed;\n resourceAccess?: KeycloakResourceAccess;\n subject?: string;\n token?: string;\n tokenParsed?: ITokenParsed;\n email?: string;\n username?: string;\n userId?: string;\n login: () => Promise<unknown> | unknown;\n logout: () => Promise<unknown> | unknown;\n}\n\nexport interface ITokenParsed extends KeycloakTokenParsed {\n 'allowed-origins'?: string[];\n email_verified?: boolean;\n preferred_username?: string;\n scope?: string;\n sid?: string;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAyBA,gCAAc,0BAzBd;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File: /src/hooks/useKeycloak/useKeycloak.ts
|
|
3
|
-
* Project: app
|
|
4
|
-
* File Created: 08-11-2022 06:04:59
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* Last Modified: 31-05-2023 12:49:27
|
|
8
|
-
* Modified By: Clay Risser
|
|
9
|
-
* -----
|
|
10
|
-
* Risser Labs LLC (c) Copyright 2021 - 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
|
-
import type { IKeycloak } from './index';
|
|
25
|
-
export declare function useKeycloak(): IKeycloak;
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defProps = Object.defineProperties;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
6
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
8
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
10
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
11
|
-
var __spreadValues = (a, b) => {
|
|
12
|
-
for (var prop in b || (b = {}))
|
|
13
|
-
if (__hasOwnProp.call(b, prop))
|
|
14
|
-
__defNormalProp(a, prop, b[prop]);
|
|
15
|
-
if (__getOwnPropSymbols)
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
23
|
-
var __export = (target, all) => {
|
|
24
|
-
for (var name in all)
|
|
25
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
26
|
-
};
|
|
27
|
-
var __copyProps = (to, from, except, desc) => {
|
|
28
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
29
|
-
for (let key of __getOwnPropNames(from))
|
|
30
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
31
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
32
|
-
}
|
|
33
|
-
return to;
|
|
34
|
-
};
|
|
35
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
|
-
var useKeycloak_exports = {};
|
|
37
|
-
__export(useKeycloak_exports, {
|
|
38
|
-
useKeycloak: () => useKeycloak
|
|
39
|
-
});
|
|
40
|
-
module.exports = __toCommonJS(useKeycloak_exports);
|
|
41
|
-
var import_multiplatform = require("multiplatform.one");
|
|
42
|
-
var import_useAuthConfig = require("../useAuthConfig");
|
|
43
|
-
var import_react_keycloak_web = require("@bitspur/react-keycloak-web");
|
|
44
|
-
var import_react_keycloak_ssr = require("@bitspur/react-keycloak-ssr");
|
|
45
|
-
function useKeycloak() {
|
|
46
|
-
var _a, _b, _c, _d, _e, _f;
|
|
47
|
-
const authConfig = (0, import_useAuthConfig.useAuthConfig)();
|
|
48
|
-
if (import_multiplatform.MultiPlatform.isStorybook) {
|
|
49
|
-
return { authenticated: true, username: "storybook", email: "storybook@example.com", userId: "0" };
|
|
50
|
-
}
|
|
51
|
-
if (import_multiplatform.MultiPlatform.isNext && authConfig.ssr) {
|
|
52
|
-
const { keycloak: keycloak2, initialized: initialized2 } = (0, import_react_keycloak_ssr.useKeycloak)();
|
|
53
|
-
return __spreadProps(__spreadValues({}, keycloak2), {
|
|
54
|
-
authenticated: initialized2 ? keycloak2 == null ? void 0 : keycloak2.authenticated : void 0,
|
|
55
|
-
email: (_a = keycloak2 == null ? void 0 : keycloak2.tokenParsed) == null ? void 0 : _a.email,
|
|
56
|
-
userId: (_b = keycloak2 == null ? void 0 : keycloak2.tokenParsed) == null ? void 0 : _b.sub,
|
|
57
|
-
username: (_c = keycloak2 == null ? void 0 : keycloak2.tokenParsed) == null ? void 0 : _c.preferred_username
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
const { keycloak, initialized } = (0, import_react_keycloak_web.useKeycloak)();
|
|
61
|
-
return __spreadProps(__spreadValues({}, keycloak), {
|
|
62
|
-
authenticated: initialized ? keycloak == null ? void 0 : keycloak.authenticated : void 0,
|
|
63
|
-
email: (_d = keycloak == null ? void 0 : keycloak.tokenParsed) == null ? void 0 : _d.email,
|
|
64
|
-
userId: (_e = keycloak == null ? void 0 : keycloak.tokenParsed) == null ? void 0 : _e.sub,
|
|
65
|
-
username: (_f = keycloak == null ? void 0 : keycloak.tokenParsed) == null ? void 0 : _f.preferred_username
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
-
0 && (module.exports = {
|
|
70
|
-
useKeycloak
|
|
71
|
-
});
|
|
72
|
-
//# sourceMappingURL=useKeycloak.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/hooks/useKeycloak/useKeycloak.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * File: /src/hooks/useKeycloak/useKeycloak.ts\n * Project: app\n * File Created: 08-11-2022 06:04:59\n * Author: Clay Risser\n * -----\n * Last Modified: 31-05-2023 12:49:27\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { IKeycloak } from './index';\nimport { MultiPlatform } from 'multiplatform.one';\nimport { useAuthConfig } from '../useAuthConfig';\nimport { useKeycloak as useReactKeycloak } from '@bitspur/react-keycloak-web';\nimport { useKeycloak as useSsrKeycloak } from '@bitspur/react-keycloak-ssr';\n\nexport function useKeycloak() {\n const authConfig = useAuthConfig();\n if (MultiPlatform.isStorybook) {\n return { authenticated: true, username: 'storybook', email: 'storybook@example.com', userId: '0' } as IKeycloak;\n }\n if (MultiPlatform.isNext && authConfig.ssr) {\n const { keycloak, initialized } = useSsrKeycloak();\n return {\n ...keycloak,\n authenticated: initialized ? keycloak?.authenticated : undefined,\n email: keycloak?.tokenParsed?.email,\n userId: keycloak?.tokenParsed?.sub,\n username: keycloak?.tokenParsed?.preferred_username,\n } as IKeycloak;\n }\n const { keycloak, initialized } = useReactKeycloak();\n return {\n ...keycloak,\n authenticated: initialized ? keycloak?.authenticated : undefined,\n email: keycloak?.tokenParsed?.email,\n userId: keycloak?.tokenParsed?.sub,\n username: keycloak?.tokenParsed?.preferred_username,\n } as IKeycloak;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAyBA,2BAA8B;AAC9B,2BAA8B;AAC9B,gCAAgD;AAChD,gCAA8C;AAEvC,SAAS,cAAc;AA9B9B;AA+BE,QAAM,iBAAa,oCAAc;AACjC,MAAI,mCAAc,aAAa;AAC7B,WAAO,EAAE,eAAe,MAAM,UAAU,aAAa,OAAO,yBAAyB,QAAQ,IAAI;AAAA,EACnG;AACA,MAAI,mCAAc,UAAU,WAAW,KAAK;AAC1C,UAAM,EAAE,UAAAA,WAAU,aAAAC,aAAY,QAAI,0BAAAC,aAAe;AACjD,WAAO,iCACFF,YADE;AAAA,MAEL,eAAeC,eAAcD,aAAA,gBAAAA,UAAU,gBAAgB;AAAA,MACvD,QAAO,KAAAA,aAAA,gBAAAA,UAAU,gBAAV,mBAAuB;AAAA,MAC9B,SAAQ,KAAAA,aAAA,gBAAAA,UAAU,gBAAV,mBAAuB;AAAA,MAC/B,WAAU,KAAAA,aAAA,gBAAAA,UAAU,gBAAV,mBAAuB;AAAA,IACnC;AAAA,EACF;AACA,QAAM,EAAE,UAAU,YAAY,QAAI,0BAAAG,aAAiB;AACnD,SAAO,iCACF,WADE;AAAA,IAEL,eAAe,cAAc,qCAAU,gBAAgB;AAAA,IACvD,QAAO,0CAAU,gBAAV,mBAAuB;AAAA,IAC9B,SAAQ,0CAAU,gBAAV,mBAAuB;AAAA,IAC/B,WAAU,0CAAU,gBAAV,mBAAuB;AAAA,EACnC;AACF;",
|
|
6
|
-
"names": ["keycloak", "initialized", "useSsrKeycloak", "useReactKeycloak"]
|
|
7
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File: /src/hooks/useKeycloak/useKeycloak.native.ts
|
|
3
|
-
* Project: app
|
|
4
|
-
* File Created: 08-11-2022 14:10:25
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* Last Modified: 24-04-2023 17:50:55
|
|
8
|
-
* Modified By: Clay Risser
|
|
9
|
-
* -----
|
|
10
|
-
* Risser Labs LLC (c) Copyright 2021 - 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
|
-
import type { AuthRequestPromptOptions, AuthSessionResult } from 'expo-auth-session';
|
|
25
|
-
import type { IKeycloak } from './index';
|
|
26
|
-
import type { KeycloakResourceAccess, KeycloakRoles, KeycloakTokenParsed } from '@bitspur/keycloak-js';
|
|
27
|
-
export declare function useKeycloak(): IKeycloak;
|
|
28
|
-
export declare class ExpoKeycloak implements IKeycloak {
|
|
29
|
-
logout: () => unknown;
|
|
30
|
-
token?: string | undefined;
|
|
31
|
-
refreshToken?: string | undefined;
|
|
32
|
-
authenticated?: boolean;
|
|
33
|
-
tokenParsed?: KeycloakTokenParsed;
|
|
34
|
-
refreshTokenParsed?: KeycloakTokenParsed;
|
|
35
|
-
subject?: string;
|
|
36
|
-
realmAccess?: KeycloakRoles;
|
|
37
|
-
resourceAccess?: KeycloakResourceAccess;
|
|
38
|
-
login: () => Promise<unknown> | unknown;
|
|
39
|
-
constructor(ready: boolean, isLoggedIn: boolean | undefined, login: (options?: AuthRequestPromptOptions) => Promise<AuthSessionResult | undefined>, logout: () => unknown, token?: string | undefined, refreshToken?: string | undefined);
|
|
40
|
-
}
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __export = (target, all) => {
|
|
9
|
-
for (var name in all)
|
|
10
|
-
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
-
};
|
|
12
|
-
var __copyProps = (to, from, except, desc) => {
|
|
13
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
-
for (let key of __getOwnPropNames(from))
|
|
15
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
-
}
|
|
18
|
-
return to;
|
|
19
|
-
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
-
var useKeycloak_native_exports = {};
|
|
30
|
-
__export(useKeycloak_native_exports, {
|
|
31
|
-
ExpoKeycloak: () => ExpoKeycloak,
|
|
32
|
-
useKeycloak: () => useKeycloak
|
|
33
|
-
});
|
|
34
|
-
module.exports = __toCommonJS(useKeycloak_native_exports);
|
|
35
|
-
var import_atob = __toESM(require("core-js-pure/stable/atob"));
|
|
36
|
-
var import_escape = __toESM(require("core-js-pure/stable/escape"));
|
|
37
|
-
var import_multiplatform = require("multiplatform.one");
|
|
38
|
-
var import_expo_keycloak_auth = require("expo-keycloak-auth");
|
|
39
|
-
function useKeycloak() {
|
|
40
|
-
if (import_multiplatform.MultiPlatform.isStorybook)
|
|
41
|
-
return { authenticated: true };
|
|
42
|
-
const { ready, login, isLoggedIn, token, logout, refreshToken } = (0, import_expo_keycloak_auth.useKeycloak)();
|
|
43
|
-
const keycloak = new ExpoKeycloak(ready, isLoggedIn, login, logout, token || void 0, refreshToken || void 0);
|
|
44
|
-
return keycloak;
|
|
45
|
-
}
|
|
46
|
-
class ExpoKeycloak {
|
|
47
|
-
constructor(ready, isLoggedIn, login, logout, token, refreshToken) {
|
|
48
|
-
this.logout = logout;
|
|
49
|
-
this.token = token;
|
|
50
|
-
this.refreshToken = refreshToken;
|
|
51
|
-
if (ready)
|
|
52
|
-
this.authenticated = isLoggedIn;
|
|
53
|
-
if (this.authenticated) {
|
|
54
|
-
if (this.token)
|
|
55
|
-
this.tokenParsed = decodeToken(this.token);
|
|
56
|
-
if (this.refreshToken) {
|
|
57
|
-
this.refreshTokenParsed = decodeToken(this.refreshToken);
|
|
58
|
-
}
|
|
59
|
-
if (this.tokenParsed) {
|
|
60
|
-
this.subject = this.tokenParsed.sub;
|
|
61
|
-
this.realmAccess = this.tokenParsed.realm_access;
|
|
62
|
-
this.resourceAccess = this.tokenParsed.resource_access;
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
this.login = () => login();
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function decodeToken(str) {
|
|
69
|
-
str = str.split(".")[1];
|
|
70
|
-
str = str.replace(/-/g, "+");
|
|
71
|
-
str = str.replace(/_/g, "/");
|
|
72
|
-
switch (str.length % 4) {
|
|
73
|
-
case 0:
|
|
74
|
-
break;
|
|
75
|
-
case 2:
|
|
76
|
-
str += "==";
|
|
77
|
-
break;
|
|
78
|
-
case 3:
|
|
79
|
-
str += "=";
|
|
80
|
-
break;
|
|
81
|
-
default:
|
|
82
|
-
throw "Invalid token";
|
|
83
|
-
}
|
|
84
|
-
str = decodeURIComponent((0, import_escape.default)((0, import_atob.default)(str)));
|
|
85
|
-
str = JSON.parse(str);
|
|
86
|
-
return str;
|
|
87
|
-
}
|
|
88
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
89
|
-
0 && (module.exports = {
|
|
90
|
-
ExpoKeycloak,
|
|
91
|
-
useKeycloak
|
|
92
|
-
});
|
|
93
|
-
//# sourceMappingURL=useKeycloak.native.js.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/hooks/useKeycloak/useKeycloak.native.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * File: /src/hooks/useKeycloak/useKeycloak.native.ts\n * Project: app\n * File Created: 08-11-2022 14:10:25\n * Author: Clay Risser\n * -----\n * Last Modified: 24-04-2023 17:50:55\n * Modified By: Clay Risser\n * -----\n * Risser Labs LLC (c) Copyright 2021 - 2022\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport atob from 'core-js-pure/stable/atob';\nimport escape from 'core-js-pure/stable/escape';\nimport type { AuthRequestPromptOptions, AuthSessionResult } from 'expo-auth-session';\nimport type { IKeycloak } from './index';\nimport type { KeycloakResourceAccess, KeycloakRoles, KeycloakTokenParsed } from '@bitspur/keycloak-js';\nimport { MultiPlatform } from 'multiplatform.one';\nimport { useKeycloak as useExpoKeycloak } from 'expo-keycloak-auth';\n\nexport function useKeycloak() {\n if (MultiPlatform.isStorybook) return { authenticated: true } as IKeycloak;\n const { ready, login, isLoggedIn, token, logout, refreshToken } = useExpoKeycloak();\n const keycloak = new ExpoKeycloak(ready, isLoggedIn, login, logout, token || undefined, refreshToken || undefined);\n return keycloak as IKeycloak;\n}\n\nexport class ExpoKeycloak implements IKeycloak {\n authenticated?: boolean;\n\n tokenParsed?: KeycloakTokenParsed;\n\n refreshTokenParsed?: KeycloakTokenParsed;\n\n subject?: string;\n\n realmAccess?: KeycloakRoles;\n\n resourceAccess?: KeycloakResourceAccess;\n\n login: () => Promise<unknown> | unknown;\n\n constructor(\n ready: boolean,\n isLoggedIn: boolean | undefined,\n login: (options?: AuthRequestPromptOptions) => Promise<AuthSessionResult | undefined>,\n public logout: () => unknown,\n public token?: string,\n public refreshToken?: string,\n ) {\n if (ready) this.authenticated = isLoggedIn;\n if (this.authenticated) {\n if (this.token) this.tokenParsed = decodeToken(this.token);\n if (this.refreshToken) {\n this.refreshTokenParsed = decodeToken(this.refreshToken);\n }\n if (this.tokenParsed) {\n this.subject = this.tokenParsed.sub;\n this.realmAccess = this.tokenParsed.realm_access;\n this.resourceAccess = this.tokenParsed.resource_access;\n }\n }\n this.login = () => login();\n }\n}\n\nfunction decodeToken(str: string) {\n str = str.split('.')[1];\n str = str.replace(/-/g, '+');\n str = str.replace(/_/g, '/');\n switch (str.length % 4) {\n case 0:\n break;\n case 2:\n str += '==';\n break;\n case 3:\n str += '=';\n break;\n default:\n throw 'Invalid token';\n }\n str = decodeURIComponent(escape(atob(str)));\n str = JSON.parse(str);\n return str as unknown as KeycloakTokenParsed;\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAwBA,kBAAiB;AACjB,oBAAmB;AAInB,2BAA8B;AAC9B,gCAA+C;AAExC,SAAS,cAAc;AAC5B,MAAI,mCAAc;AAAa,WAAO,EAAE,eAAe,KAAK;AAC5D,QAAM,EAAE,OAAO,OAAO,YAAY,OAAO,QAAQ,aAAa,QAAI,0BAAAA,aAAgB;AAClF,QAAM,WAAW,IAAI,aAAa,OAAO,YAAY,OAAO,QAAQ,SAAS,QAAW,gBAAgB,MAAS;AACjH,SAAO;AACT;AAEO,MAAM,aAAkC;AAAA,EAe7C,YACE,OACA,YACA,OACO,QACA,OACA,cACP;AAHO;AACA;AACA;AAEP,QAAI;AAAO,WAAK,gBAAgB;AAChC,QAAI,KAAK,eAAe;AACtB,UAAI,KAAK;AAAO,aAAK,cAAc,YAAY,KAAK,KAAK;AACzD,UAAI,KAAK,cAAc;AACrB,aAAK,qBAAqB,YAAY,KAAK,YAAY;AAAA,MACzD;AACA,UAAI,KAAK,aAAa;AACpB,aAAK,UAAU,KAAK,YAAY;AAChC,aAAK,cAAc,KAAK,YAAY;AACpC,aAAK,iBAAiB,KAAK,YAAY;AAAA,MACzC;AAAA,IACF;AACA,SAAK,QAAQ,MAAM,MAAM;AAAA,EAC3B;AACF;AAEA,SAAS,YAAY,KAAa;AAChC,QAAM,IAAI,MAAM,GAAG,EAAE,CAAC;AACtB,QAAM,IAAI,QAAQ,MAAM,GAAG;AAC3B,QAAM,IAAI,QAAQ,MAAM,GAAG;AAC3B,UAAQ,IAAI,SAAS,GAAG;AAAA,IACtB,KAAK;AACH;AAAA,IACF,KAAK;AACH,aAAO;AACP;AAAA,IACF,KAAK;AACH,aAAO;AACP;AAAA,IACF;AACE,YAAM;AAAA,EACV;AACA,QAAM,uBAAmB,cAAAC,aAAO,YAAAC,SAAK,GAAG,CAAC,CAAC;AAC1C,QAAM,KAAK,MAAM,GAAG;AACpB,SAAO;AACT;",
|
|
6
|
-
"names": ["useExpoKeycloak", "escape", "atob"]
|
|
7
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* File: /src/hooks/useLogin.ts
|
|
3
|
-
* Project: app
|
|
4
|
-
* File Created: 08-11-2022 08:49:14
|
|
5
|
-
* Author: Clay Risser
|
|
6
|
-
* -----
|
|
7
|
-
* Last Modified: 25-04-2023 23:09:10
|
|
8
|
-
* Modified By: Clay Risser
|
|
9
|
-
* -----
|
|
10
|
-
* Risser Labs LLC (c) Copyright 2021 - 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
|
-
export declare function useLogin(loginRoute?: string): () => void;
|