Skip to content

Commit b37f317

Browse files
committed
chore(react): add getAccessToken method to AsgardeoContextProps
1 parent 42e8933 commit b37f317

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

packages/react/src/contexts/Asgardeo/AsgardeoContext.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,14 @@ export type AsgardeoContextProps = {
9797
* @returns A promise that resolves to the decoded ID token payload.
9898
*/
9999
getDecodedIdToken?: () => Promise<IdToken>;
100+
101+
/**
102+
* Function to retrieve the access token.
103+
* This function retrieves the access token and returns it.
104+
* @remarks This does not work in the `webWorker` or any other worker environment.
105+
* @returns A promise that resolves to the access token.
106+
*/
107+
getAccessToken?: () => Promise<string>;
100108
};
101109

102110
/**
@@ -124,6 +132,7 @@ const AsgardeoContext: Context<AsgardeoContextProps | null> = createContext<null
124132
},
125133
signInOptions: {},
126134
getDecodedIdToken: null,
135+
getAccessToken: null,
127136
});
128137

129138
AsgardeoContext.displayName = 'AsgardeoContext';

0 commit comments

Comments
 (0)