Skip to content

Commit 31ce837

Browse files
[SDK] Only update isLoggedIn state on successful logins (#6846)
1 parent 68aa693 commit 31ce837

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

.changeset/large-candies-cough.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"thirdweb": patch
3+
---
4+
5+
Only update isLoggedIn state on successfull logins

packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ export function useSiweAuth(
110110

111111
return await authOptions.doLogin(signedPayload);
112112
},
113-
onSettled: () => {
113+
onSuccess: () => {
114114
return queryClient.invalidateQueries({
115115
queryKey: ["siwe_auth", "isLoggedIn"],
116116
});
@@ -126,7 +126,7 @@ export function useSiweAuth(
126126

127127
return await authOptions.doLogout();
128128
},
129-
onSettled: () => {
129+
onSuccess: () => {
130130
return queryClient.invalidateQueries({
131131
queryKey: ["siwe_auth", "isLoggedIn"],
132132
});

0 commit comments

Comments
 (0)