feat: local Google authorization for Antigravity accounts - #14
Merged
Merged
Conversation
Add an OAuth (PKCE) "本地授权登录" flow to the Antigravity account pool so admins can sign in with a Google account instead of pasting a refresh token. The backend mirrors the existing Codex OAuth loopback flow: startAntigravityOAuth builds a Google consent URL (access_type=offline + prompt=consent to force a refresh_token) and completeAntigravityOAuth exchanges the pasted callback code via the Google token endpoint, storing an antigravity-source account with its refresh token. The Antigravity page's "添加账号" modal now leads with 本地授权登录 and keeps credential import as a secondary option; the OAuth modal is variant-aware so its copy and callback hint match Google rather than ChatGPT. Rebuild the frontend bundle (index-BBl9ztAh.js). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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
startAntigravityOAuth生成 Google 同意页 URL(access_type=offline+prompt=consent强制返回 refresh_token),completeAntigravityOAuth用粘回的回调 code + PKCE verifier 向 Google token 端点换取令牌,落库为source=antigravity账号index-BBl9ztAh.js)Testing
go vet ./cmd/capi通过go test ./cmd/capi全部通过(含新增TestAntigravityAuthorizeURL)tsc -b类型检查通过,vite build构建成功🤖 Generated with Claude Code