Blueprint

Web3 & wallet auth

SIWE verification, wallet feature flags, and the disabled connector UI.

Overview

Web3Provider keeps the React Query context and renders children immediately. The wallet connector UI is disabled; obsolete SDK configuration has been removed.

Sign-in surface

  • Email/OAuth — NextAuth (src/auth/*).
  • Wallet — SIWE-related flows use siwe + ethers in auth handlers; wallet UI in src/components/sign/modal.tsx (lazy-loaded) and src/components/wallet/*.

Runtime config

  • GET /api/runtime-config — exposes safe public flags (WEB3_ENABLED, WalletConnect project id, etc.) for client gating.

Key files

  • src/lib/web3/dynamic-provider.tsx, provider.tsx, env.ts
  • src/auth/handler.ts, src/auth/config.ts — credentials / SIWE validation
  • src/app/api/runtime-config/route.ts

Note

Production may ship with Web3 disabled (isWeb3Enabled in env); docs should match the deployed flag.

Dependencies

Environment

  • NEXT_PUBLIC_WEB3_ENABLED / WEB3_ENABLED — exposed via /api/runtime-config and dynamic-provider.
  • NEXT_PUBLIC_WALLETCONNECT_PROJECT_ID, WALLETCONNECT_PROJECT_ID
  • NEXT_PUBLIC_WEB_URL, NEXT_PUBLIC_WEB3_APP_URL — SIWE domain / URI (src/lib/web3/constants.ts).
  • NEXT_PUBLIC_SUPPORTED_CHAINS — reserved legacy chain configuration; no active Wagmi connector.
  • AUTH_SECRET — NextAuth session used alongside wallet sign-in.

Database (src/db/schema.ts)

  • users — wallet_address, wallet_type, ens_domain, is_wallet_verified, supported_chains, wallet_connected_at

2026-09 authentication hardening

The wallet connector UI was already disabled. Unused Web3Modal/Wagmi dependencies and their unreferenced config have been removed. Email and Google login are unchanged. If the server wallet provider is enabled, every request must contain a valid SIWE signature for the supplied address, the configured AUTH_URL (or NEXT_PUBLIC_WEB_URL) domain and URI origin, and the nonce from the current server-signed Auth.js CSRF cookie. Messages expire after five minutes based on issuedAt; future timestamps and cross-site messages are rejected. Direct-address login and parsing an address after failed verification are never accepted. This does not re-enable the wallet connector UI.

Wallet sessions minted before this signature check are invalidated and must sign in again. Failed database persistence cannot mint a fallback authenticated identity.

Web3 & wallet auth | Tracker Dog Docs