Skip to content

Commit 5318ea6

Browse files
feat(react): Expose global loading state from the react SDK
1 parent fdab64f commit 5318ea6

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/react/src/hooks/use-authentication.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import UseAuthentication from '../models/use-authentication';
3232
const useAuthentication = (): UseAuthentication => {
3333
const contextValue: AuthContext = useContext(AsgardeoContext);
3434

35-
const {accessToken, authResponse, isAuthenticated, setUsername, user, username} = contextValue;
35+
const {accessToken, authResponse, isAuthenticated, isGlobalLoading, setUsername, user, username} = contextValue;
3636

3737
const signOut: () => void = () => {
3838
signOutApiCall().then(() => {
@@ -47,6 +47,7 @@ const useAuthentication = (): UseAuthentication => {
4747
accessToken,
4848
authResponse,
4949
isAuthenticated,
50+
isGlobalLoading,
5051
setUsername,
5152
signOut,
5253
user,

packages/react/src/models/use-authentication.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ interface UseAuthentication {
2222
accessToken: string;
2323
authResponse: AuthApiResponse;
2424
isAuthenticated: Promise<boolean> | boolean;
25+
isGlobalLoading: boolean;
2526
setUsername: (username: string) => void;
2627
signOut: () => void;
2728
user: MeAPIResponse;

0 commit comments

Comments
 (0)