Menu

#317 feat(tray): integrations OAuth — Jira browser auth + GitHub via gh CLI

closed
nobody
None
2026-06-20
2026-06-19
Anonymous
No

Originally created by: Akarsh-Hegde

Summary

  • Jira OAuth fix: start_oauth now reads JIRA_OAUTH_CLIENT_SECRET and other OAuth keys from ~/.meridian/.env and forwards them to the spawned meridian oauth-login jira process — dev builds don't bake the secret at compile time, causing a 401 access_denied. A background tokio task watches the child process and writes ~/.meridian/oauth/<provider>.error on failure so the UI surfaces the error within ~2 s instead of timing out after 3 minutes. New get_oauth_status command reads both the .json (connected) and .error (failure) sentinels; OAuthSetup polls it on every 2 s tick.

  • GitHub OAuth via gh CLI: New meridian oauth-login github subcommand uses the local gh CLI — gh auth login --web if not yet authenticated, then gh auth token to extract the token and write GITHUB_TOKEN to ~/.meridian/.env. If gh is not installed, brew install gh runs automatically (probing Homebrew at its canonical paths since the tray runs under launchd's minimal PATH). GITHUB_TOKEN is unset from every gh child process to avoid the "clear the value from the environment" conflict when it's already in .env. GitHub tracker in the UI now renders the same OAuthSetup button as Jira/Trello — no PAT to create.

Test plan

  • [ ] Jira: click "Connect Jira → Browser OAuth" — browser opens, authorizes, UI shows Connected within 2 s of callback
  • [ ] Jira error path: remove JIRA_OAUTH_CLIENT_SECRET from ~/.meridian/.env, try again — error surfaces in ~2 s (not 3 min timeout)
  • [ ] GitHub: click "Connect GitHub →" — browser opens (or gh auth refresh is silent if already authed), GITHUB_TOKEN written to ~/.meridian/.env, UI shows Connected
  • [ ] GitHub without gh: on a clean machine brew install gh runs, then browser opens
  • [ ] Disconnect GitHub: strips GITHUB_TOKEN + GITHUB_PROJECT_IDS from .env

🤖 Generated with Claude Code

Discussion

  • Anonymous

    Anonymous - 2026-06-20

    Originally posted by: Akarsh-Hegde

    Included in [#315]

     

    Related

    Tickets: #315

  • Anonymous

    Anonymous - 2026-06-20

    Ticket changed by: Akarsh-Hegde

    • status: open --> closed
     

Log in to post a comment.