Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,15 @@
import { useActiveWallet, useAutoConnect, useConnectedWallets, useDisconnect } from "thirdweb/react";
import { ecosystemWallet } from "thirdweb/wallets";
import { preAuthenticate } from "thirdweb/wallets/in-app";
import { useDisconnect as useDisconnectWagmi } from "wagmi";
import { useConnect } from "./useConnect";
import { useSiwe } from "./useSiwe";

const debug = debugB3React("useAuthentication");

export function useAuthentication(partnerId: string, loginWithSiwe?: boolean) {
const { disconnect } = useDisconnect();
const { disconnect: disconnectWagmi } = useDisconnectWagmi();
const wallets = useConnectedWallets();
const activeWallet = useActiveWallet();
const { authenticate } = useSiwe();
Expand Down Expand Up @@ -103,7 +105,7 @@
setIsAuthenticatingV2(false);
}
useAutoConnectLoadingPrevious.current = useAutoConnectLoading;
}, [useAutoConnectLoading]);

Check warning on line 108 in packages/sdk/src/global-account/react/hooks/useAuthentication.ts

View workflow job for this annotation

GitHub Actions / build-applications

React Hook useEffect has missing dependencies: 'hasStartedConnecting' and 'setIsAuthenticatingV2'. Either include them or remove the dependency array

Check warning on line 108 in packages/sdk/src/global-account/react/hooks/useAuthentication.ts

View workflow job for this annotation

GitHub Actions / build-applications

React Hook useEffect has missing dependencies: 'hasStartedConnecting' and 'setIsAuthenticatingV2'. Either include them or remove the dependency array

// Ensure isAuthenticating stays true until we're fully ready
useEffect(() => {
Expand Down Expand Up @@ -139,6 +141,9 @@
disconnect(wallet);
});

// disconnect wagmi
disconnectWagmi();

// Delete localStorage thirdweb:connected-wallet-ids
// https://npc-labs.slack.com/archives/C070E6HNG85/p1750185115273099
if (typeof localStorage !== "undefined") {
Expand Down
Loading