@multiplatform.one/keycloak 0.7.14 → 0.7.16
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/package.json +28 -28
- package/routes/index.d.ts +22 -0
- package/routes/index.js +22 -0
- package/src/Authenticated.tsx +27 -17
- package/src/authConfig.ts +3 -9
- package/src/hooks/index.ts +0 -3
- package/src/hooks/useTokensFromQuery/index.ts +1 -0
- package/src/hooks/useTokensFromState.ts +1 -1
- package/src/index.ts +3 -0
- package/src/{@types/coreJsPure.d.ts → keycloak/context.ts} +6 -11
- package/{lib/@types/expoKeycloakAuth.d.d.mts → src/keycloak/index.ts} +4 -7
- package/src/keycloak/keycloak.native.ts +148 -0
- package/src/keycloak/keycloak.ts +175 -0
- package/src/provider/AfterAuth.tsx +63 -0
- package/src/provider/{keycloakProvider.native.tsx → AuthProvider/AuthProvider.native.tsx} +8 -16
- package/src/provider/{keycloakProvider.tsx → AuthProvider/AuthProvider.tsx} +81 -94
- package/{lib/@types/expoKeycloakAuth.d.d.ts → src/provider/AuthProvider/index.ts} +4 -7
- package/src/provider/KeycloakProvider.tsx +53 -0
- package/src/{hooks/useCurrentRouteName/index.native.ts → provider/index.ts} +6 -11
- package/src/routes.ts +163 -0
- package/src/session/index.ts +22 -0
- package/src/session/session.native.ts +31 -0
- package/src/session/session.ts +68 -0
- package/src/{state/index.ts → state.ts} +5 -4
- package/src/{util.ts → token.ts} +25 -11
- package/src/types.ts +4 -1
- package/lib/@types/coreJsPure.d.d.mts +0 -2
- package/lib/@types/coreJsPure.d.d.ts +0 -2
- package/lib/@types/coreJsPure.d.js +0 -1
- package/lib/@types/coreJsPure.d.mjs +0 -0
- package/lib/@types/expoKeycloakAuth.d.js +0 -1
- package/lib/@types/expoKeycloakAuth.d.mjs +0 -0
- package/lib/Authenticated.d.mts +0 -33
- package/lib/Authenticated.d.ts +0 -33
- package/lib/Authenticated.js +0 -19
- package/lib/Authenticated.mjs +0 -20
- package/lib/authConfig.d.mts +0 -14
- package/lib/authConfig.d.ts +0 -14
- package/lib/authConfig.js +0 -8
- package/lib/authConfig.mjs +0 -9
- package/lib/chunk-2GUOEPFY.mjs +0 -0
- package/lib/chunk-3ZPHNEJL.js +0 -11
- package/lib/chunk-64PPU7Q3.mjs +0 -13
- package/lib/chunk-6NDWOV55.js +0 -1
- package/lib/chunk-7MTPH6XK.mjs +0 -26
- package/lib/chunk-A7UBOIAL.js +0 -13
- package/lib/chunk-AD6VPMID.mjs +0 -20
- package/lib/chunk-AUUZ6BI7.js +0 -78
- package/lib/chunk-AYKQVWMR.mjs +0 -0
- package/lib/chunk-BVB33X7V.mjs +0 -265
- package/lib/chunk-C2FNSVJO.js +0 -17
- package/lib/chunk-J4CCMILN.mjs +0 -41
- package/lib/chunk-K33RKJZX.js +0 -443
- package/lib/chunk-KLLABHIC.js +0 -13
- package/lib/chunk-L5HMOY4M.mjs +0 -18
- package/lib/chunk-MZ6E62HK.js +0 -33
- package/lib/chunk-NWRANDZ6.js +0 -98
- package/lib/chunk-NXTVYIBR.mjs +0 -11
- package/lib/chunk-OYWAYMFN.js +0 -17
- package/lib/chunk-RPUOO7AV.mjs +0 -10
- package/lib/chunk-RYM7KERK.mjs +0 -52
- package/lib/chunk-UBVYEZI3.js +0 -1
- package/lib/chunk-UHTKOFS6.mjs +0 -84
- package/lib/chunk-UL6L5ONI.js +0 -460
- package/lib/chunk-UOKDJT5L.mjs +0 -16
- package/lib/chunk-W5DJLFTQ.js +0 -56
- package/lib/chunk-WT5W6BSZ.js +0 -161
- package/lib/chunk-XEO3YXBM.js +0 -22
- package/lib/chunk-XO4W2SMN.mjs +0 -50
- package/lib/chunk-XVPWAAZ4.mjs +0 -76
- package/lib/chunk-Y4XMF3R6.mjs +0 -13
- package/lib/chunk-YGNNHTFE.js +0 -12
- package/lib/hooks/index.d.mts +0 -9
- package/lib/hooks/index.d.ts +0 -9
- package/lib/hooks/index.js +0 -23
- package/lib/hooks/index.mjs +0 -34
- package/lib/hooks/useAuthConfig.d.mts +0 -6
- package/lib/hooks/useAuthConfig.d.ts +0 -6
- package/lib/hooks/useAuthConfig.js +0 -8
- package/lib/hooks/useAuthConfig.mjs +0 -8
- package/lib/hooks/useCurrentRouteName/index.d.mts +0 -3
- package/lib/hooks/useCurrentRouteName/index.d.ts +0 -3
- package/lib/hooks/useCurrentRouteName/index.js +0 -7
- package/lib/hooks/useCurrentRouteName/index.mjs +0 -7
- package/lib/hooks/useCurrentRouteName/index.native.d.mts +0 -3
- package/lib/hooks/useCurrentRouteName/index.native.d.ts +0 -3
- package/lib/hooks/useCurrentRouteName/index.native.js +0 -14
- package/lib/hooks/useCurrentRouteName/index.native.mjs +0 -14
- package/lib/hooks/useKeycloak/index.d.mts +0 -46
- package/lib/hooks/useKeycloak/index.d.ts +0 -46
- package/lib/hooks/useKeycloak/index.js +0 -11
- package/lib/hooks/useKeycloak/index.mjs +0 -12
- package/lib/hooks/useKeycloak/useKeycloak.d.mts +0 -2
- package/lib/hooks/useKeycloak/useKeycloak.d.ts +0 -2
- package/lib/hooks/useKeycloak/useKeycloak.js +0 -10
- package/lib/hooks/useKeycloak/useKeycloak.mjs +0 -11
- package/lib/hooks/useKeycloak/useKeycloak.native.d.mts +0 -20
- package/lib/hooks/useKeycloak/useKeycloak.native.d.ts +0 -20
- package/lib/hooks/useKeycloak/useKeycloak.native.js +0 -80
- package/lib/hooks/useKeycloak/useKeycloak.native.mjs +0 -69
- package/lib/hooks/useLogin.d.mts +0 -3
- package/lib/hooks/useLogin.d.ts +0 -3
- package/lib/hooks/useLogin.js +0 -11
- package/lib/hooks/useLogin.mjs +0 -11
- package/lib/hooks/useTokensFromQuery/index.d.mts +0 -3
- package/lib/hooks/useTokensFromQuery/index.d.ts +0 -3
- package/lib/hooks/useTokensFromQuery/index.js +0 -7
- package/lib/hooks/useTokensFromQuery/index.mjs +0 -7
- package/lib/hooks/useTokensFromQuery/index.native.d.mts +0 -3
- package/lib/hooks/useTokensFromQuery/index.native.d.ts +0 -3
- package/lib/hooks/useTokensFromQuery/index.native.js +0 -10
- package/lib/hooks/useTokensFromQuery/index.native.mjs +0 -7
- package/lib/hooks/useTokensFromState.d.mts +0 -3
- package/lib/hooks/useTokensFromState.d.ts +0 -3
- package/lib/hooks/useTokensFromState.js +0 -9
- package/lib/hooks/useTokensFromState.mjs +0 -9
- package/lib/index.d.mts +0 -13
- package/lib/index.d.ts +0 -13
- package/lib/index.js +0 -34
- package/lib/index.mjs +0 -56
- package/lib/provider/afterAuth.d.mts +0 -29
- package/lib/provider/afterAuth.d.ts +0 -29
- package/lib/provider/afterAuth.js +0 -18
- package/lib/provider/afterAuth.mjs +0 -18
- package/lib/provider/index.d.mts +0 -39
- package/lib/provider/index.d.ts +0 -39
- package/lib/provider/index.js +0 -22
- package/lib/provider/index.mjs +0 -25
- package/lib/provider/keycloakProvider.d.mts +0 -42
- package/lib/provider/keycloakProvider.d.ts +0 -42
- package/lib/provider/keycloakProvider.js +0 -20
- package/lib/provider/keycloakProvider.mjs +0 -21
- package/lib/provider/keycloakProvider.native.d.mts +0 -29
- package/lib/provider/keycloakProvider.native.d.ts +0 -29
- package/lib/provider/keycloakProvider.native.js +0 -87
- package/lib/provider/keycloakProvider.native.mjs +0 -30
- package/lib/state/index.d.mts +0 -11
- package/lib/state/index.d.ts +0 -11
- package/lib/state/index.js +0 -7
- package/lib/state/index.mjs +0 -7
- package/lib/types.d.mts +0 -17
- package/lib/types.d.ts +0 -17
- package/lib/types.js +0 -8
- package/lib/types.mjs +0 -7
- package/lib/util.d.mts +0 -4
- package/lib/util.d.ts +0 -4
- package/lib/util.js +0 -8
- package/lib/util.mjs +0 -9
- package/src/hooks/useCurrentRouteName/index.ts +0 -34
- package/src/hooks/useKeycloak/index.ts +0 -47
- package/src/hooks/useKeycloak/useKeycloak.native.ts +0 -95
- package/src/hooks/useKeycloak/useKeycloak.ts +0 -106
- package/src/hooks/useLogin.ts +0 -47
- package/src/provider/afterAuth.tsx +0 -65
- package/src/provider/index.tsx +0 -117
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { AuthRequestPromptOptions, AuthSessionResult } from 'expo-auth-session';
|
|
2
|
-
import { IKeycloak } from './index.mjs';
|
|
3
|
-
import { KeycloakTokenParsed, KeycloakRoles, KeycloakResourceAccess } from '@bitspur/keycloak-js';
|
|
4
|
-
|
|
5
|
-
declare function useKeycloak(): IKeycloak;
|
|
6
|
-
declare class ExpoKeycloak implements IKeycloak {
|
|
7
|
-
logout: () => Promise<unknown>;
|
|
8
|
-
token?: string | undefined;
|
|
9
|
-
refreshToken?: string | undefined;
|
|
10
|
-
authenticated?: boolean;
|
|
11
|
-
tokenParsed?: KeycloakTokenParsed;
|
|
12
|
-
refreshTokenParsed?: KeycloakTokenParsed;
|
|
13
|
-
subject?: string;
|
|
14
|
-
realmAccess?: KeycloakRoles;
|
|
15
|
-
resourceAccess?: KeycloakResourceAccess;
|
|
16
|
-
login: () => Promise<unknown>;
|
|
17
|
-
constructor(ready: boolean, isLoggedIn: boolean | undefined, login: (options?: AuthRequestPromptOptions) => Promise<AuthSessionResult | undefined>, logout: () => Promise<unknown>, token?: string | undefined, refreshToken?: string | undefined);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { ExpoKeycloak, useKeycloak };
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { AuthRequestPromptOptions, AuthSessionResult } from 'expo-auth-session';
|
|
2
|
-
import { IKeycloak } from './index.js';
|
|
3
|
-
import { KeycloakTokenParsed, KeycloakRoles, KeycloakResourceAccess } from '@bitspur/keycloak-js';
|
|
4
|
-
|
|
5
|
-
declare function useKeycloak(): IKeycloak;
|
|
6
|
-
declare class ExpoKeycloak implements IKeycloak {
|
|
7
|
-
logout: () => Promise<unknown>;
|
|
8
|
-
token?: string | undefined;
|
|
9
|
-
refreshToken?: string | undefined;
|
|
10
|
-
authenticated?: boolean;
|
|
11
|
-
tokenParsed?: KeycloakTokenParsed;
|
|
12
|
-
refreshTokenParsed?: KeycloakTokenParsed;
|
|
13
|
-
subject?: string;
|
|
14
|
-
realmAccess?: KeycloakRoles;
|
|
15
|
-
resourceAccess?: KeycloakResourceAccess;
|
|
16
|
-
login: () => Promise<unknown>;
|
|
17
|
-
constructor(ready: boolean, isLoggedIn: boolean | undefined, login: (options?: AuthRequestPromptOptions) => Promise<AuthSessionResult | undefined>, logout: () => Promise<unknown>, token?: string | undefined, refreshToken?: string | undefined);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
export { ExpoKeycloak, useKeycloak };
|
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
function _class_call_check(instance, Constructor) {
|
|
3
|
-
if (!(instance instanceof Constructor)) {
|
|
4
|
-
throw new TypeError("Cannot call a class as a function");
|
|
5
|
-
}
|
|
6
|
-
}
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
function _interopRequireDefault(obj) {
|
|
11
|
-
return obj && obj.__esModule ? obj : {
|
|
12
|
-
default: obj
|
|
13
|
-
};
|
|
14
|
-
}
|
|
15
|
-
var _chunkXEO3YXBMjs = require("../../chunk-XEO3YXBM.js");
|
|
16
|
-
// src/hooks/useKeycloak/useKeycloak.native.ts
|
|
17
|
-
var _atob = require("core-js-pure/stable/atob");
|
|
18
|
-
var _atob2 = _interopRequireDefault(_atob);
|
|
19
|
-
var _escape = require("core-js-pure/stable/escape");
|
|
20
|
-
var _escape2 = _interopRequireDefault(_escape);
|
|
21
|
-
var _multiplatformone = require("multiplatform.one");
|
|
22
|
-
var _expokeycloakauth = require("expo-keycloak-auth");
|
|
23
|
-
function useKeycloak() {
|
|
24
|
-
if (_multiplatformone.MultiPlatform.isStorybook) return {
|
|
25
|
-
authenticated: true
|
|
26
|
-
};
|
|
27
|
-
var _expokeycloakauth_useKeycloak_call = _expokeycloakauth.useKeycloak.call(void 0), ready = _expokeycloakauth_useKeycloak_call.ready, login = _expokeycloakauth_useKeycloak_call.login, isLoggedIn = _expokeycloakauth_useKeycloak_call.isLoggedIn, token = _expokeycloakauth_useKeycloak_call.token, logout = _expokeycloakauth_useKeycloak_call.logout, refreshToken = _expokeycloakauth_useKeycloak_call.refreshToken;
|
|
28
|
-
var keycloak = new ExpoKeycloak(ready, isLoggedIn, login, logout, token || void 0, refreshToken || void 0);
|
|
29
|
-
return keycloak;
|
|
30
|
-
}
|
|
31
|
-
var ExpoKeycloak = function ExpoKeycloak(ready, isLoggedIn, login, logout, token, refreshToken) {
|
|
32
|
-
_class_call_check(this, ExpoKeycloak);
|
|
33
|
-
this.logout = logout;
|
|
34
|
-
this.token = token;
|
|
35
|
-
this.refreshToken = refreshToken;
|
|
36
|
-
_chunkXEO3YXBMjs.__publicField.call(void 0, this, "authenticated");
|
|
37
|
-
_chunkXEO3YXBMjs.__publicField.call(void 0, this, "tokenParsed");
|
|
38
|
-
_chunkXEO3YXBMjs.__publicField.call(void 0, this, "refreshTokenParsed");
|
|
39
|
-
_chunkXEO3YXBMjs.__publicField.call(void 0, this, "subject");
|
|
40
|
-
_chunkXEO3YXBMjs.__publicField.call(void 0, this, "realmAccess");
|
|
41
|
-
_chunkXEO3YXBMjs.__publicField.call(void 0, this, "resourceAccess");
|
|
42
|
-
_chunkXEO3YXBMjs.__publicField.call(void 0, this, "login");
|
|
43
|
-
if (ready) this.authenticated = isLoggedIn;
|
|
44
|
-
if (this.authenticated) {
|
|
45
|
-
if (this.token) this.tokenParsed = decodeToken(this.token);
|
|
46
|
-
if (this.refreshToken) {
|
|
47
|
-
this.refreshTokenParsed = decodeToken(this.refreshToken);
|
|
48
|
-
}
|
|
49
|
-
if (this.tokenParsed) {
|
|
50
|
-
this.subject = this.tokenParsed.sub;
|
|
51
|
-
this.realmAccess = this.tokenParsed.realm_access;
|
|
52
|
-
this.resourceAccess = this.tokenParsed.resource_access;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
this.login = function() {
|
|
56
|
-
return login();
|
|
57
|
-
};
|
|
58
|
-
};
|
|
59
|
-
function decodeToken(str) {
|
|
60
|
-
str = str.split(".")[1];
|
|
61
|
-
str = str.replace(/-/g, "+");
|
|
62
|
-
str = str.replace(/_/g, "/");
|
|
63
|
-
switch(str.length % 4){
|
|
64
|
-
case 0:
|
|
65
|
-
break;
|
|
66
|
-
case 2:
|
|
67
|
-
str += "==";
|
|
68
|
-
break;
|
|
69
|
-
case 3:
|
|
70
|
-
str += "=";
|
|
71
|
-
break;
|
|
72
|
-
default:
|
|
73
|
-
throw "Invalid token";
|
|
74
|
-
}
|
|
75
|
-
str = decodeURIComponent(_escape2.default.call(void 0, _atob2.default.call(void 0, str)));
|
|
76
|
-
str = JSON.parse(str);
|
|
77
|
-
return str;
|
|
78
|
-
}
|
|
79
|
-
exports.ExpoKeycloak = ExpoKeycloak;
|
|
80
|
-
exports.useKeycloak = useKeycloak;
|
|
@@ -1,69 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__publicField
|
|
3
|
-
} from "../../chunk-RPUOO7AV.mjs";
|
|
4
|
-
|
|
5
|
-
// src/hooks/useKeycloak/useKeycloak.native.ts
|
|
6
|
-
import atob from "core-js-pure/stable/atob";
|
|
7
|
-
import escape from "core-js-pure/stable/escape";
|
|
8
|
-
import { MultiPlatform } from "multiplatform.one";
|
|
9
|
-
import { useKeycloak as useExpoKeycloak } from "expo-keycloak-auth";
|
|
10
|
-
function useKeycloak() {
|
|
11
|
-
if (MultiPlatform.isStorybook)
|
|
12
|
-
return { authenticated: true };
|
|
13
|
-
const { ready, login, isLoggedIn, token, logout, refreshToken } = useExpoKeycloak();
|
|
14
|
-
const keycloak = new ExpoKeycloak(ready, isLoggedIn, login, logout, token || void 0, refreshToken || void 0);
|
|
15
|
-
return keycloak;
|
|
16
|
-
}
|
|
17
|
-
var ExpoKeycloak = class {
|
|
18
|
-
constructor(ready, isLoggedIn, login, logout, token, refreshToken) {
|
|
19
|
-
this.logout = logout;
|
|
20
|
-
this.token = token;
|
|
21
|
-
this.refreshToken = refreshToken;
|
|
22
|
-
__publicField(this, "authenticated");
|
|
23
|
-
__publicField(this, "tokenParsed");
|
|
24
|
-
__publicField(this, "refreshTokenParsed");
|
|
25
|
-
__publicField(this, "subject");
|
|
26
|
-
__publicField(this, "realmAccess");
|
|
27
|
-
__publicField(this, "resourceAccess");
|
|
28
|
-
__publicField(this, "login");
|
|
29
|
-
if (ready)
|
|
30
|
-
this.authenticated = isLoggedIn;
|
|
31
|
-
if (this.authenticated) {
|
|
32
|
-
if (this.token)
|
|
33
|
-
this.tokenParsed = decodeToken(this.token);
|
|
34
|
-
if (this.refreshToken) {
|
|
35
|
-
this.refreshTokenParsed = decodeToken(this.refreshToken);
|
|
36
|
-
}
|
|
37
|
-
if (this.tokenParsed) {
|
|
38
|
-
this.subject = this.tokenParsed.sub;
|
|
39
|
-
this.realmAccess = this.tokenParsed.realm_access;
|
|
40
|
-
this.resourceAccess = this.tokenParsed.resource_access;
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
this.login = () => login();
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
function decodeToken(str) {
|
|
47
|
-
str = str.split(".")[1];
|
|
48
|
-
str = str.replace(/-/g, "+");
|
|
49
|
-
str = str.replace(/_/g, "/");
|
|
50
|
-
switch (str.length % 4) {
|
|
51
|
-
case 0:
|
|
52
|
-
break;
|
|
53
|
-
case 2:
|
|
54
|
-
str += "==";
|
|
55
|
-
break;
|
|
56
|
-
case 3:
|
|
57
|
-
str += "=";
|
|
58
|
-
break;
|
|
59
|
-
default:
|
|
60
|
-
throw "Invalid token";
|
|
61
|
-
}
|
|
62
|
-
str = decodeURIComponent(escape(atob(str)));
|
|
63
|
-
str = JSON.parse(str);
|
|
64
|
-
return str;
|
|
65
|
-
}
|
|
66
|
-
export {
|
|
67
|
-
ExpoKeycloak,
|
|
68
|
-
useKeycloak
|
|
69
|
-
};
|
package/lib/hooks/useLogin.d.mts
DELETED
package/lib/hooks/useLogin.d.ts
DELETED
package/lib/hooks/useLogin.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
var _chunkMZ6E62HKjs = require("../chunk-MZ6E62HK.js");
|
|
6
|
-
require("../chunk-OYWAYMFN.js");
|
|
7
|
-
require("../chunk-UL6L5ONI.js");
|
|
8
|
-
require("../chunk-3ZPHNEJL.js");
|
|
9
|
-
require("../chunk-A7UBOIAL.js");
|
|
10
|
-
require("../chunk-XEO3YXBM.js");
|
|
11
|
-
exports.useLogin = _chunkMZ6E62HKjs.useLogin;
|
package/lib/hooks/useLogin.mjs
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
require("../../chunk-XEO3YXBM.js");
|
|
6
|
-
// src/hooks/useTokensFromQuery/index.native.ts
|
|
7
|
-
var useTokensFromQuery = function() {
|
|
8
|
-
return false;
|
|
9
|
-
};
|
|
10
|
-
exports.useTokensFromQuery = useTokensFromQuery;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
var _chunkYGNNHTFEjs = require("../chunk-YGNNHTFE.js");
|
|
6
|
-
require("../chunk-C2FNSVJO.js");
|
|
7
|
-
require("../chunk-NWRANDZ6.js");
|
|
8
|
-
require("../chunk-XEO3YXBM.js");
|
|
9
|
-
exports.useTokensFromState = _chunkYGNNHTFEjs.useTokensFromState;
|
package/lib/index.d.mts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { Authenticated, AuthenticatedProps, withAuthenticated } from './Authenticated.mjs';
|
|
2
|
-
export { AuthConfig, AuthConfigContext, defaultAuthConfig } from './authConfig.mjs';
|
|
3
|
-
export { useAuthConfig } from './hooks/useAuthConfig.mjs';
|
|
4
|
-
export { useCurrentRouteName } from './hooks/useCurrentRouteName/index.mjs';
|
|
5
|
-
export { IKeycloak, ITokenParsed, Keycloak, useKeycloak } from './hooks/useKeycloak/index.mjs';
|
|
6
|
-
export { useLogin } from './hooks/useLogin.mjs';
|
|
7
|
-
export { useTokensFromQuery } from './hooks/useTokensFromQuery/index.mjs';
|
|
8
|
-
export { useTokensFromState } from './hooks/useTokensFromState.mjs';
|
|
9
|
-
export { AuthProvider, AuthProviderProps } from './provider/index.mjs';
|
|
10
|
-
export { KeycloakProvider, KeycloakProviderProps, MessageSchema, defaultKeycloakInitOptions } from './provider/keycloakProvider.mjs';
|
|
11
|
-
import 'react';
|
|
12
|
-
import '@bitspur/keycloak-js';
|
|
13
|
-
import '@bitspur/react-keycloak-core';
|
package/lib/index.d.ts
DELETED
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export { Authenticated, AuthenticatedProps, withAuthenticated } from './Authenticated.js';
|
|
2
|
-
export { AuthConfig, AuthConfigContext, defaultAuthConfig } from './authConfig.js';
|
|
3
|
-
export { useAuthConfig } from './hooks/useAuthConfig.js';
|
|
4
|
-
export { useCurrentRouteName } from './hooks/useCurrentRouteName/index.js';
|
|
5
|
-
export { IKeycloak, ITokenParsed, Keycloak, useKeycloak } from './hooks/useKeycloak/index.js';
|
|
6
|
-
export { useLogin } from './hooks/useLogin.js';
|
|
7
|
-
export { useTokensFromQuery } from './hooks/useTokensFromQuery/index.js';
|
|
8
|
-
export { useTokensFromState } from './hooks/useTokensFromState.js';
|
|
9
|
-
export { AuthProvider, AuthProviderProps } from './provider/index.js';
|
|
10
|
-
export { KeycloakProvider, KeycloakProviderProps, MessageSchema, defaultKeycloakInitOptions } from './provider/keycloakProvider.js';
|
|
11
|
-
import 'react';
|
|
12
|
-
import '@bitspur/keycloak-js';
|
|
13
|
-
import '@bitspur/react-keycloak-core';
|
package/lib/index.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
var _chunkWT5W6BSZjs = require("./chunk-WT5W6BSZ.js");
|
|
6
|
-
var _chunkK33RKJZXjs = require("./chunk-K33RKJZX.js");
|
|
7
|
-
require("./chunk-W5DJLFTQ.js");
|
|
8
|
-
var _chunkAUUZ6BI7js = require("./chunk-AUUZ6BI7.js");
|
|
9
|
-
require("./chunk-UBVYEZI3.js");
|
|
10
|
-
require("./chunk-6NDWOV55.js");
|
|
11
|
-
var _chunkKLLABHICjs = require("./chunk-KLLABHIC.js");
|
|
12
|
-
var _chunkMZ6E62HKjs = require("./chunk-MZ6E62HK.js");
|
|
13
|
-
var _chunkOYWAYMFNjs = require("./chunk-OYWAYMFN.js");
|
|
14
|
-
var _chunkUL6L5ONIjs = require("./chunk-UL6L5ONI.js");
|
|
15
|
-
var _chunk3ZPHNEJLjs = require("./chunk-3ZPHNEJL.js");
|
|
16
|
-
var _chunkYGNNHTFEjs = require("./chunk-YGNNHTFE.js");
|
|
17
|
-
require("./chunk-C2FNSVJO.js");
|
|
18
|
-
var _chunkA7UBOIALjs = require("./chunk-A7UBOIAL.js");
|
|
19
|
-
require("./chunk-NWRANDZ6.js");
|
|
20
|
-
require("./chunk-XEO3YXBM.js");
|
|
21
|
-
exports.AuthConfigContext = _chunkA7UBOIALjs.AuthConfigContext;
|
|
22
|
-
exports.AuthProvider = _chunkWT5W6BSZjs.AuthProvider;
|
|
23
|
-
exports.Authenticated = _chunkAUUZ6BI7js.Authenticated;
|
|
24
|
-
exports.Keycloak = _chunkUL6L5ONIjs.Keycloak;
|
|
25
|
-
exports.KeycloakProvider = _chunkK33RKJZXjs.KeycloakProvider;
|
|
26
|
-
exports.defaultAuthConfig = _chunkA7UBOIALjs.defaultAuthConfig;
|
|
27
|
-
exports.defaultKeycloakInitOptions = _chunkK33RKJZXjs.defaultKeycloakInitOptions;
|
|
28
|
-
exports.useAuthConfig = _chunk3ZPHNEJLjs.useAuthConfig;
|
|
29
|
-
exports.useCurrentRouteName = _chunkOYWAYMFNjs.useCurrentRouteName;
|
|
30
|
-
exports.useKeycloak = _chunkUL6L5ONIjs.useKeycloak;
|
|
31
|
-
exports.useLogin = _chunkMZ6E62HKjs.useLogin;
|
|
32
|
-
exports.useTokensFromQuery = _chunkKLLABHICjs.useTokensFromQuery;
|
|
33
|
-
exports.useTokensFromState = _chunkYGNNHTFEjs.useTokensFromState;
|
|
34
|
-
exports.withAuthenticated = _chunkAUUZ6BI7js.withAuthenticated;
|
package/lib/index.mjs
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AuthProvider
|
|
3
|
-
} from "./chunk-XVPWAAZ4.mjs";
|
|
4
|
-
import {
|
|
5
|
-
KeycloakProvider,
|
|
6
|
-
defaultKeycloakInitOptions
|
|
7
|
-
} from "./chunk-BVB33X7V.mjs";
|
|
8
|
-
import "./chunk-XO4W2SMN.mjs";
|
|
9
|
-
import {
|
|
10
|
-
Authenticated,
|
|
11
|
-
withAuthenticated
|
|
12
|
-
} from "./chunk-RYM7KERK.mjs";
|
|
13
|
-
import "./chunk-AYKQVWMR.mjs";
|
|
14
|
-
import "./chunk-2GUOEPFY.mjs";
|
|
15
|
-
import {
|
|
16
|
-
useTokensFromQuery
|
|
17
|
-
} from "./chunk-NXTVYIBR.mjs";
|
|
18
|
-
import {
|
|
19
|
-
useLogin
|
|
20
|
-
} from "./chunk-J4CCMILN.mjs";
|
|
21
|
-
import {
|
|
22
|
-
useCurrentRouteName
|
|
23
|
-
} from "./chunk-L5HMOY4M.mjs";
|
|
24
|
-
import {
|
|
25
|
-
Keycloak,
|
|
26
|
-
useKeycloak
|
|
27
|
-
} from "./chunk-UHTKOFS6.mjs";
|
|
28
|
-
import {
|
|
29
|
-
useAuthConfig
|
|
30
|
-
} from "./chunk-Y4XMF3R6.mjs";
|
|
31
|
-
import {
|
|
32
|
-
useTokensFromState
|
|
33
|
-
} from "./chunk-UOKDJT5L.mjs";
|
|
34
|
-
import "./chunk-AD6VPMID.mjs";
|
|
35
|
-
import {
|
|
36
|
-
AuthConfigContext,
|
|
37
|
-
defaultAuthConfig
|
|
38
|
-
} from "./chunk-64PPU7Q3.mjs";
|
|
39
|
-
import "./chunk-7MTPH6XK.mjs";
|
|
40
|
-
import "./chunk-RPUOO7AV.mjs";
|
|
41
|
-
export {
|
|
42
|
-
AuthConfigContext,
|
|
43
|
-
AuthProvider,
|
|
44
|
-
Authenticated,
|
|
45
|
-
Keycloak,
|
|
46
|
-
KeycloakProvider,
|
|
47
|
-
defaultAuthConfig,
|
|
48
|
-
defaultKeycloakInitOptions,
|
|
49
|
-
useAuthConfig,
|
|
50
|
-
useCurrentRouteName,
|
|
51
|
-
useKeycloak,
|
|
52
|
-
useLogin,
|
|
53
|
-
useTokensFromQuery,
|
|
54
|
-
useTokensFromState,
|
|
55
|
-
withAuthenticated
|
|
56
|
-
};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ReactNode, FC } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* File: /src/provider/afterAuth.tsx
|
|
5
|
-
* Project: @multiplatform.one/keycloak
|
|
6
|
-
* File Created: 22-06-2023 10:07:56
|
|
7
|
-
* Author: Clay Risser
|
|
8
|
-
* -----
|
|
9
|
-
* BitSpur (c) Copyright 2021 - 2023
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
interface AfterAuthProps {
|
|
25
|
-
children: ReactNode;
|
|
26
|
-
}
|
|
27
|
-
declare const AfterAuth: FC<AfterAuthProps>;
|
|
28
|
-
|
|
29
|
-
export { AfterAuth, type AfterAuthProps };
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { ReactNode, FC } from 'react';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* File: /src/provider/afterAuth.tsx
|
|
5
|
-
* Project: @multiplatform.one/keycloak
|
|
6
|
-
* File Created: 22-06-2023 10:07:56
|
|
7
|
-
* Author: Clay Risser
|
|
8
|
-
* -----
|
|
9
|
-
* BitSpur (c) Copyright 2021 - 2023
|
|
10
|
-
*
|
|
11
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
12
|
-
* you may not use this file except in compliance with the License.
|
|
13
|
-
* You may obtain a copy of the License at
|
|
14
|
-
*
|
|
15
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
16
|
-
*
|
|
17
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
18
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
19
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
20
|
-
* See the License for the specific language governing permissions and
|
|
21
|
-
* limitations under the License.
|
|
22
|
-
*/
|
|
23
|
-
|
|
24
|
-
interface AfterAuthProps {
|
|
25
|
-
children: ReactNode;
|
|
26
|
-
}
|
|
27
|
-
declare const AfterAuth: FC<AfterAuthProps>;
|
|
28
|
-
|
|
29
|
-
export { AfterAuth, type AfterAuthProps };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
var _chunkW5DJLFTQjs = require("../chunk-W5DJLFTQ.js");
|
|
6
|
-
require("../chunk-UBVYEZI3.js");
|
|
7
|
-
require("../chunk-6NDWOV55.js");
|
|
8
|
-
require("../chunk-KLLABHIC.js");
|
|
9
|
-
require("../chunk-MZ6E62HK.js");
|
|
10
|
-
require("../chunk-OYWAYMFN.js");
|
|
11
|
-
require("../chunk-UL6L5ONI.js");
|
|
12
|
-
require("../chunk-3ZPHNEJL.js");
|
|
13
|
-
require("../chunk-YGNNHTFE.js");
|
|
14
|
-
require("../chunk-C2FNSVJO.js");
|
|
15
|
-
require("../chunk-A7UBOIAL.js");
|
|
16
|
-
require("../chunk-NWRANDZ6.js");
|
|
17
|
-
require("../chunk-XEO3YXBM.js");
|
|
18
|
-
exports.AfterAuth = _chunkW5DJLFTQjs.AfterAuth;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
AfterAuth
|
|
3
|
-
} from "../chunk-XO4W2SMN.mjs";
|
|
4
|
-
import "../chunk-AYKQVWMR.mjs";
|
|
5
|
-
import "../chunk-2GUOEPFY.mjs";
|
|
6
|
-
import "../chunk-NXTVYIBR.mjs";
|
|
7
|
-
import "../chunk-J4CCMILN.mjs";
|
|
8
|
-
import "../chunk-L5HMOY4M.mjs";
|
|
9
|
-
import "../chunk-UHTKOFS6.mjs";
|
|
10
|
-
import "../chunk-Y4XMF3R6.mjs";
|
|
11
|
-
import "../chunk-UOKDJT5L.mjs";
|
|
12
|
-
import "../chunk-AD6VPMID.mjs";
|
|
13
|
-
import "../chunk-64PPU7Q3.mjs";
|
|
14
|
-
import "../chunk-7MTPH6XK.mjs";
|
|
15
|
-
import "../chunk-RPUOO7AV.mjs";
|
|
16
|
-
export {
|
|
17
|
-
AfterAuth
|
|
18
|
-
};
|
package/lib/provider/index.d.mts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { AuthClientEvent, AuthClientError, AuthClientTokens } from '@bitspur/react-keycloak-core';
|
|
2
|
-
import { AuthConfig } from '../authConfig.mjs';
|
|
3
|
-
import { ReactNode, ComponentType, FC } from 'react';
|
|
4
|
-
import { KeycloakConfig, KeycloakInitOptions } from '@bitspur/keycloak-js';
|
|
5
|
-
export { KeycloakProvider, KeycloakProviderProps, MessageSchema, defaultKeycloakInitOptions } from './keycloakProvider.mjs';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* File: /src/provider/index.tsx
|
|
9
|
-
* Project: @multiplatform.one/keycloak
|
|
10
|
-
* File Created: 22-06-2023 10:07:56
|
|
11
|
-
* Author: Clay Risser
|
|
12
|
-
* -----
|
|
13
|
-
* BitSpur (c) Copyright 2021 - 2023
|
|
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
|
-
|
|
28
|
-
interface AuthProviderProps extends Partial<Omit<AuthConfig, 'persist'>>, Partial<Omit<KeycloakConfig, 'url'>>, KeycloakInitOptions {
|
|
29
|
-
children: ReactNode;
|
|
30
|
-
cookies?: unknown;
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
baseUrl?: string;
|
|
33
|
-
loadingComponent?: ComponentType;
|
|
34
|
-
onEvent?: (eventType: AuthClientEvent, error?: AuthClientError) => void;
|
|
35
|
-
onTokens?: (tokens: AuthClientTokens) => void;
|
|
36
|
-
}
|
|
37
|
-
declare const AuthProvider: FC<AuthProviderProps>;
|
|
38
|
-
|
|
39
|
-
export { AuthProvider, type AuthProviderProps };
|
package/lib/provider/index.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { AuthClientEvent, AuthClientError, AuthClientTokens } from '@bitspur/react-keycloak-core';
|
|
2
|
-
import { AuthConfig } from '../authConfig.js';
|
|
3
|
-
import { ReactNode, ComponentType, FC } from 'react';
|
|
4
|
-
import { KeycloakConfig, KeycloakInitOptions } from '@bitspur/keycloak-js';
|
|
5
|
-
export { KeycloakProvider, KeycloakProviderProps, MessageSchema, defaultKeycloakInitOptions } from './keycloakProvider.js';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* File: /src/provider/index.tsx
|
|
9
|
-
* Project: @multiplatform.one/keycloak
|
|
10
|
-
* File Created: 22-06-2023 10:07:56
|
|
11
|
-
* Author: Clay Risser
|
|
12
|
-
* -----
|
|
13
|
-
* BitSpur (c) Copyright 2021 - 2023
|
|
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
|
-
|
|
28
|
-
interface AuthProviderProps extends Partial<Omit<AuthConfig, 'persist'>>, Partial<Omit<KeycloakConfig, 'url'>>, KeycloakInitOptions {
|
|
29
|
-
children: ReactNode;
|
|
30
|
-
cookies?: unknown;
|
|
31
|
-
disabled?: boolean;
|
|
32
|
-
baseUrl?: string;
|
|
33
|
-
loadingComponent?: ComponentType;
|
|
34
|
-
onEvent?: (eventType: AuthClientEvent, error?: AuthClientError) => void;
|
|
35
|
-
onTokens?: (tokens: AuthClientTokens) => void;
|
|
36
|
-
}
|
|
37
|
-
declare const AuthProvider: FC<AuthProviderProps>;
|
|
38
|
-
|
|
39
|
-
export { AuthProvider, type AuthProviderProps };
|
package/lib/provider/index.js
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
var _chunkWT5W6BSZjs = require("../chunk-WT5W6BSZ.js");
|
|
6
|
-
var _chunkK33RKJZXjs = require("../chunk-K33RKJZX.js");
|
|
7
|
-
require("../chunk-W5DJLFTQ.js");
|
|
8
|
-
require("../chunk-UBVYEZI3.js");
|
|
9
|
-
require("../chunk-6NDWOV55.js");
|
|
10
|
-
require("../chunk-KLLABHIC.js");
|
|
11
|
-
require("../chunk-MZ6E62HK.js");
|
|
12
|
-
require("../chunk-OYWAYMFN.js");
|
|
13
|
-
require("../chunk-UL6L5ONI.js");
|
|
14
|
-
require("../chunk-3ZPHNEJL.js");
|
|
15
|
-
require("../chunk-YGNNHTFE.js");
|
|
16
|
-
require("../chunk-C2FNSVJO.js");
|
|
17
|
-
require("../chunk-A7UBOIAL.js");
|
|
18
|
-
require("../chunk-NWRANDZ6.js");
|
|
19
|
-
require("../chunk-XEO3YXBM.js");
|
|
20
|
-
exports.AuthProvider = _chunkWT5W6BSZjs.AuthProvider;
|
|
21
|
-
exports.KeycloakProvider = _chunkK33RKJZXjs.KeycloakProvider;
|
|
22
|
-
exports.defaultKeycloakInitOptions = _chunkK33RKJZXjs.defaultKeycloakInitOptions;
|