Skip to content

fix: ignore stray oauth callback requests - #481

Open
HwangJohn wants to merge 1 commit into
langchain-ai:mainfrom
HwangJohn:fix/oauth-callback-stray-requests
Open

fix: ignore stray oauth callback requests#481
HwangJohn wants to merge 1 commit into
langchain-ai:mainfrom
HwangJohn:fix/oauth-callback-stray-requests

Conversation

@HwangJohn

Copy link
Copy Markdown
Contributor

Summary

  • keep the OAuth callback server waiting when browsers request non-callback paths like /favicon.ico
  • only reject the pending OAuth flow for malformed real /callback requests
  • cover the redirect URI, stray request, missing callback data, provider error, and shutdown trailing request cases

Why

Browsers and local tooling can send extra requests to the loopback OAuth server before the provider redirect completes. Those requests should not fail the login attempt before the real callback arrives.

No dedicated issue; found during an OAuth callback hardening sweep.

Testing

  • corepack pnpm exec vitest run test/oauth-callback-server.test.ts passed
  • corepack pnpm run format:check passed
  • corepack pnpm run lint:check passed
  • corepack pnpm run typecheck passed
  • git diff --check passed
  • corepack pnpm test was attempted on Windows and still fails outside this change in existing test/env-behavior.test.ts HOME/permission assertions plus Mermaid/jsdom timeout tests

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant