Skip to content

feat(cli): finish browser sign-in on gitdog.dev - #6

Merged
hyochan merged 3 commits into
mainfrom
feat/branded-login-completion
Nov 5, 2026
Merged

hyochan merged 3 commits into
mainfrom
feat/branded-login-completion

Conversation

@hyochan

@hyochan hyochan commented Nov 5, 2026 •

Copy link
Copy Markdown
Member

Summary

  • Replace the plain-text 127.0.0.1 sign-in page with a redirect to https://gitdog.dev/cli/login.
  • Report the real result: the callback is held until the session is saved, and a failed exchange shows a failure page.
  • Accept auth.gitdog.dev as a sign-in origin for the official backend only.

Changes

  • createLoginListener takes the site URL and exposes complete(); close() reports failure if a browser is still waiting.
  • The redirect keeps Referrer-Policy: no-referrer, so the callback's code and state are not sent to the site.
  • validateAuthRedirect allows the new origin only when the API is the default production backend.

Rollout

  1. Deploy the result page first: https://github.com/hyodotdev/gitdog.dev/pull/63
  2. Release this CLI version.
  3. Only then set CUSTOM_AUTH_SITE_URL in production. Version 0.2.1 rejects auth.gitdog.dev with "unexpected sign-in URL".

This PR does not bump the package version.

Test plan

  • bun run lint and bun run typecheck pass
  • bun run test passes (98 tests), including held, failed, cancelled and disconnected callbacks
  • Followed the built listener's redirect to a local result page with a fixture code
  • Sign in against production through GitHub
  • Sign in through auth.gitdog.dev once the domain and callback URL are configured

🤖 Generated with Claude Code

The sign-in tab said Gitdog had received the code before the CLI had
exchanged it, on a plain-text 127.0.0.1 page. Hold the callback until
the session is saved, then redirect to the hosted result page with the
real outcome. A failed exchange or cancelled login reports failure.

Accept auth.gitdog.dev as a sign-in origin for the official backend only,
so the server can move sign-in off the convex.site host. Custom backends
keep their existing origin checks.
@hyochan hyochan added the 🎯 feature New feature label Nov 5, 2026
@hyochan
hyochan merged commit bf34853 into main Nov 5, 2026
3 checks passed
@hyochan
hyochan deleted the feat/branded-login-completion branch November 5, 2026 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

🎯 feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant