Skip to content

Commit

Permalink
Merge pull request #36 from DonOmalVindula/feat/staple.com-fixes
Browse files Browse the repository at this point in the history
feat(react): Expose global loading state from the react SDK
  • Loading branch information
DonOmalVindula committed Jun 28, 2024
2 parents fdab64f + 39b7402 commit 89ef686
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/thick-eagles-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@asgardeo/react": patch
---

Expose global loading state from the react SDK
3 changes: 2 additions & 1 deletion packages/react/src/hooks/use-authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import UseAuthentication from '../models/use-authentication';
const useAuthentication = (): UseAuthentication => {
const contextValue: AuthContext = useContext(AsgardeoContext);

const {accessToken, authResponse, isAuthenticated, setUsername, user, username} = contextValue;
const {accessToken, authResponse, isAuthenticated, isGlobalLoading, setUsername, user, username} = contextValue;

const signOut: () => void = () => {
signOutApiCall().then(() => {
Expand All @@ -47,6 +47,7 @@ const useAuthentication = (): UseAuthentication => {
accessToken,
authResponse,
isAuthenticated,
isGlobalLoading,
setUsername,
signOut,
user,
Expand Down
1 change: 1 addition & 0 deletions packages/react/src/models/use-authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ interface UseAuthentication {
accessToken: string;
authResponse: AuthApiResponse;
isAuthenticated: Promise<boolean> | boolean;
isGlobalLoading: boolean;
setUsername: (username: string) => void;
signOut: () => void;
user: MeAPIResponse;
Expand Down

0 comments on commit 89ef686

Please sign in to comment.