diff --git a/.changeset/tall-melons-sneeze.md b/.changeset/tall-melons-sneeze.md new file mode 100644 index 00000000000..9c08fd4893b --- /dev/null +++ b/.changeset/tall-melons-sneeze.md @@ -0,0 +1,5 @@ +--- +"thirdweb": patch +--- + +Fix revalidation with siwe auth in ConnectEmbed diff --git a/packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts b/packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts index 1419b5affae..4df6dcbd616 100644 --- a/packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts +++ b/packages/thirdweb/src/react/core/hooks/auth/useSiweAuth.ts @@ -66,12 +66,13 @@ export function useSiweAuth( } return authOptions.isLoggedIn(activeAccount.address); }, + gcTime: 0, placeholderData: false, refetchOnWindowFocus: false, }); const loginMutation = useMutation({ - mutationKey: ["siwe_auth", "login"], + mutationKey: ["siwe_auth", "login", activeAccount?.address], mutationFn: async () => { if (!authOptions) { throw new Error("No auth options provided"); @@ -117,7 +118,7 @@ export function useSiweAuth( }); const logoutMutation = useMutation({ - mutationKey: ["siwe_auth", "logout"], + mutationKey: ["siwe_auth", "logout", activeAccount?.address], mutationFn: async () => { if (!authOptions) { throw new Error("No auth options provided");