@multiplatform.one/keycloak 6.0.4 → 6.1.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/dist/cjs/index.cjs +19 -6
- package/dist/cjs/index.native.cjs +717 -0
- package/dist/esm/index.js +18 -5
- package/dist/esm/index.native.js +684 -0
- package/package.json +14 -10
- package/src/Authenticated.tsx +3 -1
- package/src/Loading.tsx +10 -2
- package/src/betterAuth/expoAuthFlow.native.ts +187 -0
- package/src/frappeToken.native.ts +45 -0
- package/src/frappeToken.ts +10 -0
- package/src/index.ts +1 -0
- package/src/provider/KeycloakProvider.tsx +11 -0
- package/src/provider/authProvider/index.native.tsx +72 -64
- package/src/session/index.native.ts +32 -7
package/dist/esm/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// src/Authenticated.tsx
|
|
2
2
|
import { isIframe as isIframe3, isServer as isServer3 } from "@multiplatform.one/platform";
|
|
3
3
|
import { useEffect } from "react";
|
|
4
|
-
import { Text } from "
|
|
4
|
+
import { Text } from "react-native";
|
|
5
5
|
|
|
6
6
|
// src/hooks/useAuthConfig.ts
|
|
7
7
|
import { useContext } from "react";
|
|
@@ -450,13 +450,16 @@ import { logger as logger2 } from "@multiplatform.one/logger";
|
|
|
450
450
|
import { useCallback, useEffect as useEffect3, useMemo, useState } from "react";
|
|
451
451
|
|
|
452
452
|
// src/Loading.tsx
|
|
453
|
-
import { Text as Text2 } from "
|
|
454
|
-
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
453
|
+
import { ActivityIndicator, Text as Text2, View } from "react-native";
|
|
454
|
+
import { jsx as jsx3, jsxs } from "react/jsx-runtime";
|
|
455
455
|
function Loading({ loadingComponent }) {
|
|
456
456
|
const { debug } = useAuthConfig();
|
|
457
457
|
const LoadingComponent = loadingComponent;
|
|
458
458
|
if (typeof LoadingComponent === "undefined") {
|
|
459
|
-
return /* @__PURE__ */
|
|
459
|
+
return /* @__PURE__ */ jsxs(View, { style: { flex: 1, alignItems: "center", justifyContent: "center" }, children: [
|
|
460
|
+
/* @__PURE__ */ jsx3(ActivityIndicator, {}),
|
|
461
|
+
debug ? /* @__PURE__ */ jsx3(Text2, { children: "loading" }) : null
|
|
462
|
+
] });
|
|
460
463
|
}
|
|
461
464
|
return /* @__PURE__ */ jsx3(LoadingComponent, {});
|
|
462
465
|
}
|
|
@@ -803,8 +806,10 @@ import { useMemo as useMemo2 } from "react";
|
|
|
803
806
|
import { jsx as jsx5 } from "react/jsx-runtime";
|
|
804
807
|
function KeycloakProvider({
|
|
805
808
|
baseUrl,
|
|
809
|
+
betterAuthBaseUrl,
|
|
806
810
|
children,
|
|
807
811
|
clientId,
|
|
812
|
+
expoScheme,
|
|
808
813
|
loginRedirectUri,
|
|
809
814
|
debug,
|
|
810
815
|
disabled,
|
|
@@ -824,12 +829,19 @@ function KeycloakProvider({
|
|
|
824
829
|
clientId: clientId || "app",
|
|
825
830
|
publicClientId,
|
|
826
831
|
realm: realm || "main",
|
|
827
|
-
url: baseUrl ?? ""
|
|
832
|
+
url: baseUrl ?? "",
|
|
833
|
+
betterAuthBaseUrl,
|
|
834
|
+
expoScheme
|
|
828
835
|
},
|
|
829
836
|
children
|
|
830
837
|
}
|
|
831
838
|
) });
|
|
832
839
|
}
|
|
840
|
+
|
|
841
|
+
// src/frappeToken.ts
|
|
842
|
+
async function getKeycloakBearerToken() {
|
|
843
|
+
return void 0;
|
|
844
|
+
}
|
|
833
845
|
export {
|
|
834
846
|
AfterAuth,
|
|
835
847
|
AuthConfigContext,
|
|
@@ -841,6 +853,7 @@ export {
|
|
|
841
853
|
KeycloakProvider,
|
|
842
854
|
defaultAuthConfig,
|
|
843
855
|
getAllWalletAddresses,
|
|
856
|
+
getKeycloakBearerToken,
|
|
844
857
|
getWalletAddresses,
|
|
845
858
|
getWalletsFromToken,
|
|
846
859
|
hasWallets,
|