@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.
|
@@ -109,6 +109,16 @@ export type AsgardeoContextProps = {
|
|
|
109
109
|
* @returns A promise that resolves to the token response or the raw response.
|
|
110
110
|
*/
|
|
111
111
|
exchangeToken: (config: TokenExchangeRequestConfig) => Promise<TokenResponse | Response>;
|
|
112
|
+
/**
|
|
113
|
+
* Re-initializes the client with a new configuration.
|
|
114
|
+
*
|
|
115
|
+
* @remarks
|
|
116
|
+
* This can be partial configuration to update only specific fields.
|
|
117
|
+
*
|
|
118
|
+
* @param config - New configuration to re-initialize the client with.
|
|
119
|
+
* @returns Promise resolving to boolean indicating success.
|
|
120
|
+
*/
|
|
121
|
+
reInitialize: (config: Partial<AsgardeoReactConfig>) => Promise<boolean>;
|
|
112
122
|
} & Pick<AsgardeoReactConfig, 'storage'>;
|
|
113
123
|
/**
|
|
114
124
|
* Context object for managing the Authentication flow builder core context.
|
package/dist/index.js
CHANGED
|
@@ -37,7 +37,8 @@ var AsgardeoContext = createContext({
|
|
|
37
37
|
getDecodedIdToken: null,
|
|
38
38
|
getAccessToken: null,
|
|
39
39
|
exchangeToken: null,
|
|
40
|
-
storage: "sessionStorage"
|
|
40
|
+
storage: "sessionStorage",
|
|
41
|
+
reInitialize: null
|
|
41
42
|
});
|
|
42
43
|
AsgardeoContext.displayName = "AsgardeoContext";
|
|
43
44
|
var AsgardeoContext_default = AsgardeoContext;
|
|
@@ -544,6 +545,23 @@ var AsgardeoReactClient = class extends AsgardeoBrowserClient {
|
|
|
544
545
|
return this.asgardeo.init({ ...config, organizationHandle: resolvedOrganizationHandle });
|
|
545
546
|
});
|
|
546
547
|
}
|
|
548
|
+
reInitialize(config) {
|
|
549
|
+
return this.withLoading(async () => {
|
|
550
|
+
let isInitialized;
|
|
551
|
+
try {
|
|
552
|
+
await this.asgardeo.reInitialize(config);
|
|
553
|
+
isInitialized = true;
|
|
554
|
+
} catch (error) {
|
|
555
|
+
throw new AsgardeoRuntimeError(
|
|
556
|
+
`Failed to check if the client is initialized: ${error instanceof Error ? error.message : String(error)}`,
|
|
557
|
+
"AsgardeoReactClient-reInitialize-RuntimeError-001",
|
|
558
|
+
"react",
|
|
559
|
+
"An error occurred while checking the initialization status of the client."
|
|
560
|
+
);
|
|
561
|
+
}
|
|
562
|
+
return isInitialized;
|
|
563
|
+
});
|
|
564
|
+
}
|
|
547
565
|
async updateUserProfile(payload, userId) {
|
|
548
566
|
throw new Error("Not implemented");
|
|
549
567
|
}
|
|
@@ -1663,6 +1681,7 @@ var AsgardeoProvider = ({
|
|
|
1663
1681
|
request: asgardeo.request.bind(asgardeo),
|
|
1664
1682
|
requestAll: asgardeo.requestAll.bind(asgardeo)
|
|
1665
1683
|
},
|
|
1684
|
+
reInitialize: asgardeo.reInitialize.bind(asgardeo),
|
|
1666
1685
|
signInOptions,
|
|
1667
1686
|
getDecodedIdToken: asgardeo.getDecodedIdToken.bind(asgardeo),
|
|
1668
1687
|
exchangeToken: asgardeo.exchangeToken.bind(asgardeo),
|