Skip to content

Commit 89ef686

Browse files
Merge pull request #36 from DonOmalVindula/feat/staple.com-fixes
feat(react): Expose global loading state from the react SDK
2 parents fdab64f + 39b7402 commit 89ef686

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

.changeset/thick-eagles-camp.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@asgardeo/react": patch
3+
---
4+
5+
Expose global loading state from the react SDK

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)