You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(cloud): unblock credits-balance CORS + restore wallet reconnect on /bsc
Two visible regressions on the live BSC flow:
1) CORS preflight rejection on `/api/credits/balance`
CreditsProvider was sending `Pragma: no-cache` alongside `Cache-Control:
no-cache, no-store, must-revalidate`. The `Cache-Control` value already
disables caching for any modern proxy; `Pragma` is HTTP/1.0-era cruft
kept "just in case". Sending it on a cross-origin call to
`api.elizacloud.ai` forces a CORS preflight to list `pragma` in
`Access-Control-Allow-Headers`, which the Worker's CORS config doesn't,
so the actual GET was rejected with `Request header field pragma is not
allowed`. Dropping the header from the request is the correct fix —
no protocol semantics change, and the API CORS allowlist stays narrow.
2) Wallet stuck on "Connect Wallet" after a successful MetaMask connect
`StewardWalletProviders` was setting `reconnectOnMount={false}` on the
`WagmiProvider`. With that flag, wagmi refuses to restore an existing
connector session when the provider mounts. On /bsc this surfaced as:
the user connects via the RainbowKit modal, MetaMask shows "site
connected", but as soon as React re-renders past the connect event
(e.g. when the wallet attach flow swaps the AttachWalletCard for the
DirectCryptoCreditCard), the new component's `useAccount` /
`ConnectButton.Custom` boots with `account = undefined` and the button
regresses to "Connect Wallet" with no clickable recovery. The pay
handler then bails with "Connect your BSC wallet first" because
`isConnected` is false.
Default behavior (`reconnectOnMount: true`) is what the BSC promo,
dashboard billing, and any return-visit flow want. The login surface
already gates SIWE on an explicit user click via `pendingSignRef`, so
auto-reconnect can't accidentally fire a signature prompt — flipping
the default is safe across all consumers of these providers.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|`browser-extension/chrome`|`typecheck`, explicit build skip |`build:tsup` only after resolving browser bundling of Node-only workspace deps; load unpacked for runtime validation. |
0 commit comments