@asgardeo/browser 0.1.3 → 0.1.5

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.
@@ -182,10 +182,10 @@ export declare class AsgardeoSPAClient {
182
182
  *
183
183
  * @example
184
184
  *```
185
- * auth.trySignInSilently()
185
+ * auth.signInSilently()
186
186
  *```
187
187
  */
188
- trySignInSilently(additionalParams?: Record<string, string | boolean>, tokenRequestConfig?: {
188
+ signInSilently(additionalParams?: Record<string, string | boolean>, tokenRequestConfig?: {
189
189
  params: Record<string, unknown>;
190
190
  }): Promise<User | boolean | undefined>;
191
191
  /**
@@ -38,7 +38,7 @@ export declare class AuthenticationHelper<T extends MainThreadClientConfig | Web
38
38
  requestAccessToken(authorizationCode?: string, sessionState?: string, checkSession?: () => Promise<void>, pkce?: string, state?: string, tokenRequestConfig?: {
39
39
  params: Record<string, unknown>;
40
40
  }): Promise<User>;
41
- trySignInSilently(constructSilentSignInUrl: (additionalParams?: Record<string, string | boolean>) => Promise<string>, requestAccessToken: (authzCode: string, sessionState: string, state: string, tokenRequestConfig?: {
41
+ signInSilently(constructSilentSignInUrl: (additionalParams?: Record<string, string | boolean>) => Promise<string>, requestAccessToken: (authzCode: string, sessionState: string, state: string, tokenRequestConfig?: {
42
42
  params: Record<string, unknown>;
43
43
  }) => Promise<User>, sessionManagementHelper: SessionManagementHelperInterface, additionalParams?: Record<string, string | boolean>, tokenRequestConfig?: {
44
44
  params: Record<string, unknown>;
@@ -45,7 +45,7 @@ export interface MainThreadClientInterface {
45
45
  getStorageManager(): Promise<StorageManager<MainThreadClientConfig>>;
46
46
  isSignedIn(): Promise<boolean>;
47
47
  reInitialize(config: Partial<AuthClientConfig<MainThreadClientConfig>>): Promise<void>;
48
- trySignInSilently(additionalParams?: Record<string, string | boolean>, tokenRequestConfig?: {
48
+ signInSilently(additionalParams?: Record<string, string | boolean>, tokenRequestConfig?: {
49
49
  params: Record<string, unknown>;
50
50
  }): Promise<User | boolean>;
51
51
  isSessionActive(): Promise<boolean>;
@@ -76,7 +76,7 @@ export interface WebWorkerClientInterface {
76
76
  setHttpRequestFinishCallback(callback: () => void): void;
77
77
  refreshAccessToken(): Promise<User>;
78
78
  reInitialize(config: Partial<AuthClientConfig<WebWorkerClientConfig>>): Promise<void>;
79
- trySignInSilently(additionalParams?: Record<string, string | boolean>, tokenRequestConfig?: {
79
+ signInSilently(additionalParams?: Record<string, string | boolean>, tokenRequestConfig?: {
80
80
  params: Record<string, unknown>;
81
81
  }): Promise<User | boolean>;
82
82
  }
@@ -32,7 +32,7 @@ export interface HttpRequestInterface {
32
32
  httpFinishCallback?: () => void;
33
33
  enableRetrievingSignOutURLFromSession?: (config: SPACustomGrantConfig) => void;
34
34
  }
35
- export interface HttpRequestConfig extends AxiosRequestConfig {
35
+ export interface HttpRequestConfig extends AxiosRequestConfig, Omit<Request, 'headers' | 'method' | 'signal' | 'url'> {
36
36
  attachToken?: boolean;
37
37
  shouldEncodeToFormData?: boolean;
38
38
  shouldAttachIDPAccessToken?: boolean;
package/dist/cjs/index.js CHANGED
@@ -2981,7 +2981,7 @@ var MainThreadClient = async (instanceID, config, getAuthHelper) => {
2981
2981
  }
2982
2982
  return url;
2983
2983
  };
2984
- const trySignInSilently = async (additionalParams, tokenRequestConfig) => _authenticationHelper.trySignInSilently(
2984
+ const signInSilently = async (additionalParams, tokenRequestConfig) => _authenticationHelper.signInSilently(
2985
2985
  constructSilentSignInUrl,
2986
2986
  requestAccessToken,
2987
2987
  _sessionManagementHelper,
@@ -3033,7 +3033,7 @@ var MainThreadClient = async (instanceID, config, getAuthHelper) => {
3033
3033
  setHttpRequestSuccessCallback,
3034
3034
  signIn,
3035
3035
  signOut,
3036
- trySignInSilently,
3036
+ signInSilently,
3037
3037
  reInitialize
3038
3038
  };
3039
3039
  };
@@ -3364,7 +3364,7 @@ var AuthenticationHelper = class {
3364
3364
  )
3365
3365
  );
3366
3366
  }
3367
- async trySignInSilently(constructSilentSignInUrl, requestAccessToken, sessionManagementHelper, additionalParams, tokenRequestConfig) {
3367
+ async signInSilently(constructSilentSignInUrl, requestAccessToken, sessionManagementHelper, additionalParams, tokenRequestConfig) {
3368
3368
  if (SPAUtils.isInitializedSilentSignIn()) {
3369
3369
  await sessionManagementHelper.receivePromptNoneResponse();
3370
3370
  return Promise.resolve({
@@ -3729,8 +3729,8 @@ var WebWorkerClient = async (instanceID, config, webWorker, getAuthHelper) => {
3729
3729
  const url = urlObject.toString();
3730
3730
  return url;
3731
3731
  };
3732
- const trySignInSilently = async (additionalParams, tokenRequestConfig) => {
3733
- return await _authenticationHelper.trySignInSilently(
3732
+ const signInSilently = async (additionalParams, tokenRequestConfig) => {
3733
+ return await _authenticationHelper.signInSilently(
3734
3734
  constructSilentSignInUrl,
3735
3735
  requestAccessToken,
3736
3736
  _sessionManagementHelper,
@@ -4020,7 +4020,7 @@ var WebWorkerClient = async (instanceID, config, webWorker, getAuthHelper) => {
4020
4020
  setHttpRequestSuccessCallback,
4021
4021
  signIn,
4022
4022
  signOut,
4023
- trySignInSilently,
4023
+ signInSilently,
4024
4024
  reInitialize
4025
4025
  };
4026
4026
  };
@@ -4326,15 +4326,15 @@ var _AsgardeoSPAClient = class _AsgardeoSPAClient {
4326
4326
  *
4327
4327
  * @example
4328
4328
  *```
4329
- * auth.trySignInSilently()
4329
+ * auth.signInSilently()
4330
4330
  *```
4331
4331
  */
4332
- async trySignInSilently(additionalParams, tokenRequestConfig) {
4332
+ async signInSilently(additionalParams, tokenRequestConfig) {
4333
4333
  await this.isInitialized();
4334
4334
  if (SPAUtils.wasSignInCalled()) {
4335
4335
  return void 0;
4336
4336
  }
4337
- return this._client?.trySignInSilently(additionalParams, tokenRequestConfig).then((response) => {
4337
+ return this._client?.signInSilently(additionalParams, tokenRequestConfig).then((response) => {
4338
4338
  if (this._onSignInCallback && response) {
4339
4339
  this._onSignInCallback(response);
4340
4340
  }