Skip to content

feat: local Google authorization for Antigravity accounts - #14

Merged
mzrodyu merged 1 commit into
mainfrom
feat/antigravity-local-oauth
Sep 23, 2026
Merged

mzrodyu merged 1 commit into
mainfrom
feat/antigravity-local-oauth

Conversation

@mzrodyu

@mzrodyu mzrodyu commented Sep 23, 2026

Copy link
Copy Markdown
Owner

Summary

  • Antigravity 账号池新增「本地授权登录」:用 Google 账号 OAuth (PKCE) 登录直接入池,不用再手动粘 refresh token
  • 后端复用 Codex 的 loopback 授权流程:startAntigravityOAuth 生成 Google 同意页 URL(access_type=offline + prompt=consent 强制返回 refresh_token),completeAntigravityOAuth 用粘回的回调 code + PKCE verifier 向 Google token 端点换取令牌,落库为 source=antigravity 账号
  • 「添加账号」弹窗在 Antigravity 变体下以「本地授权登录」为主推,凭据导入降为次选;OAuth 弹窗做成 variant-aware,文案与回调提示对应 Google 而非 ChatGPT
  • 重建前端 bundle(index-BBl9ztAh.js)

Testing

  • go vet ./cmd/capi 通过
  • go test ./cmd/capi 全部通过(含新增 TestAntigravityAuthorizeURL)
  • tsc -b 类型检查通过,vite build 构建成功

🤖 Generated with Claude Code

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>
@mzrodyu
mzrodyu merged commit 87875bf into main Sep 23, 2026
1 check passed
@mzrodyu
mzrodyu deleted the feat/antigravity-local-oauth branch September 23, 2026 06:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant