@asgardeo/react 0.20.0 → 0.21.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.
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
2
+ * Copyright (c) 2025-2026, WSO2 LLC. (https://www.wso2.com).
3
3
  *
4
4
  * WSO2 LLC. licenses this file to you under the Apache License,
5
5
  * Version 2.0 (the "License"); you may not use this file except
@@ -15,7 +15,7 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { AsgardeoSPAClient, AuthClientConfig, User, LegacyConfig as Config, IdToken, Hooks, HttpClientInstance, HttpRequestConfig, HttpResponse, OIDCEndpoints, SignInConfig, SPACustomGrantConfig } from '@asgardeo/browser';
18
+ import { AsgardeoSPAClient, AuthClientConfig, User, LegacyConfig as Config, IdToken, Hooks, HttpClient, HttpRequestConfig, HttpResponse, OIDCEndpoints, SignInConfig, SPACustomGrantConfig } from '@asgardeo/browser';
19
19
  import { AuthStateInterface } from './models';
20
20
  declare class AuthAPI {
21
21
  static DEFAULT_STATE: AuthStateInterface;
@@ -133,9 +133,9 @@ declare class AuthAPI {
133
133
  /**
134
134
  * This methods returns the Axios http client.
135
135
  *
136
- * @return {HttpClientInstance} - The Axios HTTP client.
136
+ * @return {HttpClient} - The Axios HTTP client.
137
137
  */
138
- getHttpClient(): Promise<HttpClientInstance>;
138
+ getHttpClient(): Promise<HttpClient>;
139
139
  /**
140
140
  * This method decodes a JWT token payload and returns it.
141
141
  *
@@ -15,7 +15,7 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { AsgardeoAuthException, AuthClientConfig, AuthSPAClientConfig, Config, TokenExchangeRequestConfig, IdToken, Hooks, HttpClientInstance, HttpRequestConfig, HttpResponse, OIDCEndpoints, SignInConfig, User } from '@asgardeo/browser';
18
+ import { AsgardeoAuthException, AuthClientConfig, AuthSPAClientConfig, Config, TokenExchangeRequestConfig, IdToken, Hooks, HttpClient, HttpRequestConfig, HttpResponse, OIDCEndpoints, SignInConfig, User } from '@asgardeo/browser';
19
19
  export interface ReactConfig {
20
20
  disableAutoSignIn?: boolean;
21
21
  /**
@@ -65,7 +65,7 @@ export interface AuthContextInterface {
65
65
  getAccessToken(): Promise<string>;
66
66
  getDecodedIDPIDToken(): Promise<IdToken>;
67
67
  getDecodedIdToken(sessionId?: string): Promise<IdToken>;
68
- getHttpClient(): Promise<HttpClientInstance>;
68
+ getHttpClient(): Promise<HttpClient>;
69
69
  getIdToken(): Promise<string>;
70
70
  getOpenIDProviderEndpoints(): Promise<OIDCEndpoints>;
71
71
  getUser(): Promise<User>;
package/dist/cjs/index.js CHANGED
@@ -427,7 +427,7 @@ var _AuthAPI = class _AuthAPI {
427
427
  /**
428
428
  * This methods returns the Axios http client.
429
429
  *
430
- * @return {HttpClientInstance} - The Axios HTTP client.
430
+ * @return {HttpClient} - The Axios HTTP client.
431
431
  */
432
432
  async getHttpClient() {
433
433
  return this.client.getHttpClient();
@@ -748,7 +748,11 @@ var AsgardeoReactClient = class extends import_browser6.AsgardeoBrowserClient {
748
748
  resolvedOrganizationHandle = (0, import_browser6.deriveOrganizationHandleFromBaseUrl)(config?.baseUrl);
749
749
  }
750
750
  return this.withLoading(async () => {
751
- this.initializeConfig = { ...config, organizationHandle: resolvedOrganizationHandle };
751
+ this.initializeConfig = {
752
+ ...config,
753
+ organizationHandle: resolvedOrganizationHandle,
754
+ periodicTokenRefresh: config?.tokenLifecycle?.refreshToken?.autoRefresh ?? config?.periodicTokenRefresh
755
+ };
752
756
  return this.asgardeo.init(this.initializeConfig);
753
757
  });
754
758
  }