Summary
There is no first-class hook to read whether the user is authenticated. wagmi's useAccount().isConnected is not the auth source of truth, which leads consumers to gate their UI on the wrong signal.
Details
wagmi reconnects from its localStorage cache on load and reports isConnected: true even when the ZeroDev wallet session is absent or expired. The real auth state is the session in the connector's zustand store (ZeroDevWalletState.session), but there's no public hook exposing it.
Gating on isConnected produces two failure modes:
- App treats a user as logged in with no valid session → the next sign / send fails.
- Clicking a stale "connect" button on an already-connected connector throws:
Connector already connected. Version: @wagmi/core@2.22.1.
To get the correct state today, you have to reach into internals:
const connector = getZeroDevConnector(config)
const store = await getZeroDevStore(connector)
const session = store.getState().session // not a documented/public hook
store.subscribe(...)
Ask
Ship a public useSession() / useIsAuthenticated() hook (returning { session, isAuthenticated, ready }), and document clearly that wagmi isConnected is not the auth source of truth for this connector.
Environment
@zerodev/wallet-react@0.0.1-alpha.26, wagmi 2.19.5, mode 7702.
Summary
There is no first-class hook to read whether the user is authenticated. wagmi's
useAccount().isConnectedis not the auth source of truth, which leads consumers to gate their UI on the wrong signal.Details
wagmi reconnects from its localStorage cache on load and reports
isConnected: trueeven when the ZeroDev wallet session is absent or expired. The real auth state is the session in the connector's zustand store (ZeroDevWalletState.session), but there's no public hook exposing it.Gating on
isConnectedproduces two failure modes:Connector already connected. Version: @wagmi/core@2.22.1.To get the correct state today, you have to reach into internals:
Ask
Ship a public
useSession()/useIsAuthenticated()hook (returning{ session, isAuthenticated, ready }), and document clearly that wagmiisConnectedis not the auth source of truth for this connector.Environment
@zerodev/wallet-react@0.0.1-alpha.26, wagmi2.19.5, mode7702.