File tree Expand file tree Collapse file tree 3 files changed +16
-0
lines changed
Expand file tree Collapse file tree 3 files changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -160,6 +160,12 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
160160 } ) ;
161161 }
162162
163+ async getIdToken ( ) : Promise < string > {
164+ return this . withLoading ( async ( ) => {
165+ return this . asgardeo . getIdToken ( ) ;
166+ } ) ;
167+ }
168+
163169 async getUserProfile ( options ?: any ) : Promise < UserProfile > {
164170 return this . withLoading ( async ( ) => {
165171 try {
Original file line number Diff line number Diff line change @@ -113,6 +113,14 @@ export type AsgardeoContextProps = {
113113 */
114114 getDecodedIdToken : ( ) => Promise < IdToken > ;
115115
116+ /**
117+ * Function to retrieve the ID token.
118+ * This function retrieves the ID token and returns it.
119+ *
120+ * @returns A promise that resolves to the ID token.
121+ */
122+ getIdToken : ( ) => Promise < string > ;
123+
116124 /**
117125 * Retrieves the access token stored in the storage.
118126 * This function retrieves the access token and returns it.
@@ -167,6 +175,7 @@ const AsgardeoContext: Context<AsgardeoContextProps | null> = createContext<null
167175 } ,
168176 signInOptions : { } ,
169177 getDecodedIdToken : null ,
178+ getIdToken : null ,
170179 getAccessToken : null ,
171180 exchangeToken : null ,
172181 storage : 'sessionStorage' ,
Original file line number Diff line number Diff line change @@ -519,6 +519,7 @@ const AsgardeoProvider: FC<PropsWithChildren<AsgardeoProviderProps>> = ({
519519 reInitialize : asgardeo . reInitialize . bind ( asgardeo ) ,
520520 signInOptions,
521521 getDecodedIdToken : asgardeo . getDecodedIdToken . bind ( asgardeo ) ,
522+ getIdToken : asgardeo . getIdToken . bind ( asgardeo ) ,
522523 exchangeToken : asgardeo . exchangeToken . bind ( asgardeo ) ,
523524 syncSession,
524525 platform : config ?. platform ,
You can’t perform that action at this time.
0 commit comments