File tree Expand file tree Collapse file tree 3 files changed +29
-3
lines changed
Expand file tree Collapse file tree 3 files changed +29
-3
lines changed Original file line number Diff line number Diff line change 1+ ---
2+ ' @asgardeo/javascript ' : minor
3+ ' @asgardeo/react ' : minor
4+ ---
5+
6+ Add tokenLifecycle.refreshToken.autoRefresh config to replace legacy periodicTokenRefresh
Original file line number Diff line number Diff line change 11/**
2- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
2+ * Copyright (c) 2025-2026 , WSO2 LLC. (https://www.wso2.com).
33 *
44 * WSO2 LLC. licenses this file to you under the Apache License,
55 * Version 2.0 (the "License"); you may not use this file except
@@ -307,6 +307,21 @@ export interface BaseConfig<T = unknown> extends WithPreferences {
307307 */
308308 syncSession ?: boolean ;
309309
310+ /**
311+ * Configuration for token lifecycle management.
312+ */
313+ tokenLifecycle ?: {
314+ /**
315+ * Configuration for refresh token behavior.
316+ */
317+ refreshToken ?: {
318+ /**
319+ * Whether to automatically refresh the access token periodically before it expires.
320+ */
321+ autoRefresh ?: boolean ;
322+ } ;
323+ } ;
324+
310325 /**
311326 * Token validation configuration.
312327 * This allows you to configure how the SDK validates tokens received from the authorization server.
Original file line number Diff line number Diff line change 11/**
2- * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com).
2+ * Copyright (c) 2025-2026 , WSO2 LLC. (https://www.wso2.com).
33 *
44 * WSO2 LLC. licenses this file to you under the Apache License,
55 * Version 2.0 (the "License"); you may not use this file except
@@ -126,7 +126,12 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
126126 }
127127
128128 return this . withLoading ( async ( ) => {
129- this . initializeConfig = { ...config , organizationHandle : resolvedOrganizationHandle } ;
129+ this . initializeConfig = {
130+ ...config ,
131+ organizationHandle : resolvedOrganizationHandle ,
132+ periodicTokenRefresh : config ?. tokenLifecycle ?. refreshToken ?. autoRefresh
133+ ?? ( config as any ) ?. periodicTokenRefresh ,
134+ } ;
130135
131136 return this . asgardeo . init ( this . initializeConfig as any ) ;
132137 } ) ;
You can’t perform that action at this time.
0 commit comments