File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
react/src/contexts/Asgardeo Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change 18
18
19
19
import { Config } from '@asgardeo/javascript' ;
20
20
21
- export type AsgardeoBrowserConfig = Config ;
21
+ export type AsgardeoBrowserConfig = Config < 'sessionStorage' | 'localStorage' | 'browserMemory' | 'webWorker' > ;
Original file line number Diff line number Diff line change @@ -197,6 +197,12 @@ export interface BaseConfig<T = unknown> extends WithPreferences {
197
197
* @see {@link https://openid.net/specs/openid-connect-session-management-1_0.html#IframeBasedSessionManagement }
198
198
*/
199
199
syncSession ?: boolean ;
200
+
201
+ /**
202
+ * Storage mechanism to use for storing tokens and session data.
203
+ * The values should be defined at the framework layer.
204
+ */
205
+ storage ?: T ;
200
206
}
201
207
202
208
export interface WithPreferences {
Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ import {
27
27
TokenResponse ,
28
28
} from '@asgardeo/browser' ;
29
29
import AsgardeoReactClient from '../../AsgardeoReactClient' ;
30
+ import { AsgardeoReactConfig } from '../../models/config' ;
30
31
31
32
/**
32
33
* Props interface of {@link AsgardeoContext}
@@ -120,7 +121,7 @@ export type AsgardeoContextProps = {
120
121
* @returns A promise that resolves to the token response or the raw response.
121
122
*/
122
123
exchangeToken ?: ( config : TokenExchangeRequestConfig ) => Promise < TokenResponse | Response > ;
123
- } ;
124
+ } & Pick < AsgardeoReactConfig , 'storage' > ;
124
125
125
126
/**
126
127
* Context object for managing the Authentication flow builder core context.
@@ -149,6 +150,7 @@ const AsgardeoContext: Context<AsgardeoContextProps | null> = createContext<null
149
150
getDecodedIdToken : null ,
150
151
getAccessToken : null ,
151
152
exchangeToken : null ,
153
+ storage : 'sessionStorage' ,
152
154
} ) ;
153
155
154
156
AsgardeoContext . displayName = 'AsgardeoContext' ;
You can’t perform that action at this time.
0 commit comments