Repository navigation
feat(cli): finish browser sign-in on gitdog.dev - #6
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
127.0.0.1sign-in page with a redirect tohttps://gitdog.dev/cli/login.auth.gitdog.devas a sign-in origin for the official backend only.Changes
createLoginListenertakes the site URL and exposescomplete();close()reports failure if a browser is still waiting.Referrer-Policy: no-referrer, so the callback's code and state are not sent to the site.validateAuthRedirectallows the new origin only when the API is the default production backend.Rollout
CUSTOM_AUTH_SITE_URLin production. Version 0.2.1 rejectsauth.gitdog.devwith "unexpected sign-in URL".This PR does not bump the package version.
Test plan
bun run lintandbun run typecheckpassbun run testpasses (98 tests), including held, failed, cancelled and disconnected callbacksauth.gitdog.devonce the domain and callback URL are configured🤖 Generated with Claude Code