exchange-code endpoint is called twice. The second request always fails with 400 status.React.StrictMode in production builds (index.tsx). In React 18+, StrictMode causes double invocation of useEffect (mount → unmount → mount) even in production.isFirstRender guard in OAuthCallbackPage uses useRef:useRef resets to true, causing handleCallback() (which calls exchangeOAuthCodeForToken) to execute twice.Unable to login with the OAuth provider. The code has already been used.
exchange-code should only be called once, regardless of StrictMode?