@asgardeo/react 0.5.24 → 0.5.25
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.
|
@@ -39,6 +39,7 @@ declare class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactC
|
|
|
39
39
|
*/
|
|
40
40
|
private withLoading;
|
|
41
41
|
initialize(config: AsgardeoReactConfig, storage?: Storage): Promise<boolean>;
|
|
42
|
+
reInitialize(config: Partial<AsgardeoReactConfig>): Promise<boolean>;
|
|
42
43
|
updateUserProfile(payload: any, userId?: string): Promise<User>;
|
|
43
44
|
getUser(options?: any): Promise<User>;
|
|
44
45
|
getDecodedIdToken(sessionId?: string): Promise<IdToken>;
|
package/dist/cjs/index.js
CHANGED
|
@@ -183,7 +183,8 @@ var AsgardeoContext = (0, import_react.createContext)({
|
|
|
183
183
|
getDecodedIdToken: null,
|
|
184
184
|
getAccessToken: null,
|
|
185
185
|
exchangeToken: null,
|
|
186
|
-
storage: "sessionStorage"
|
|
186
|
+
storage: "sessionStorage",
|
|
187
|
+
reInitialize: null
|
|
187
188
|
});
|
|
188
189
|
AsgardeoContext.displayName = "AsgardeoContext";
|
|
189
190
|
var AsgardeoContext_default = AsgardeoContext;
|
|
@@ -663,6 +664,23 @@ var AsgardeoReactClient = class extends import_browser6.AsgardeoBrowserClient {
|
|
|
663
664
|
return this.asgardeo.init({ ...config, organizationHandle: resolvedOrganizationHandle });
|
|
664
665
|
});
|
|
665
666
|
}
|
|
667
|
+
reInitialize(config) {
|
|
668
|
+
return this.withLoading(async () => {
|
|
669
|
+
let isInitialized;
|
|
670
|
+
try {
|
|
671
|
+
await this.asgardeo.reInitialize(config);
|
|
672
|
+
isInitialized = true;
|
|
673
|
+
} catch (error) {
|
|
674
|
+
throw new import_browser6.AsgardeoRuntimeError(
|
|
675
|
+
`Failed to check if the client is initialized: ${error instanceof Error ? error.message : String(error)}`,
|
|
676
|
+
"AsgardeoReactClient-reInitialize-RuntimeError-001",
|
|
677
|
+
"react",
|
|
678
|
+
"An error occurred while checking the initialization status of the client."
|
|
679
|
+
);
|
|
680
|
+
}
|
|
681
|
+
return isInitialized;
|
|
682
|
+
});
|
|
683
|
+
}
|
|
666
684
|
async updateUserProfile(payload, userId) {
|
|
667
685
|
throw new Error("Not implemented");
|
|
668
686
|
}
|
|
@@ -1774,6 +1792,7 @@ var AsgardeoProvider = ({
|
|
|
1774
1792
|
request: asgardeo.request.bind(asgardeo),
|
|
1775
1793
|
requestAll: asgardeo.requestAll.bind(asgardeo)
|
|
1776
1794
|
},
|
|
1795
|
+
reInitialize: asgardeo.reInitialize.bind(asgardeo),
|
|
1777
1796
|
signInOptions,
|
|
1778
1797
|
getDecodedIdToken: asgardeo.getDecodedIdToken.bind(asgardeo),
|
|
1779
1798
|
exchangeToken: asgardeo.exchangeToken.bind(asgardeo),
|