Skip to content

fix: preserve desktop MCP OAuth consent through login#208

Open
oshtz wants to merge 1 commit into
oblien:mainfrom
oshtz:agent/fix-desktop-mcp-oauth
Open

fix: preserve desktop MCP OAuth consent through login#208
oshtz wants to merge 1 commit into
oblien:mainfrom
oshtz:agent/fix-desktop-mcp-oauth

Conversation

@oshtz

@oshtz oshtz commented Jul 24, 2026

Copy link
Copy Markdown

Closes #119

Summary

Current main now advertises the packaged desktop app's dynamic API and dashboard origins correctly. One part of the MCP OAuth flow remains broken in zero-auth mode: creating the local session drops the pending consent return path, and /mcp/authorize is not accepted by the existing safe returnTo allowlist.

This change:

  • preserves the validated MCP consent path when the desktop login page requests a zero-auth session
  • relays that path through /api/auth/desktop-login and back through the dashboard's existing redirect validator
  • allows /mcp/authorize in the safe relative-path allowlist while continuing to reject external redirects
  • adds focused regression coverage for the MCP consent return path

The branch is rebased on current main and leaves its OPENSHIP_ADVERTISED_ORIGIN implementation unchanged.

Testing

  • dashboard test suite: 27 tests pass
  • API and dashboard TypeScript checks pass
  • external and protocol-relative returnTo values remain rejected

@oshtz
oshtz marked this pull request as ready for review July 24, 2026 14:39
@Hydralerne

Copy link
Copy Markdown
Member

cool

@oshtz
oshtz force-pushed the agent/fix-desktop-mcp-oauth branch from 0449de2 to 96e8fcd Compare July 24, 2026 18:48
@oshtz oshtz changed the title fix: support desktop MCP OAuth on dynamic ports fix: preserve desktop MCP OAuth consent through login Jul 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants