Skip to content

fix: make admin-token prompt password-manager friendly - #3380

Closed
x3M3x wants to merge 1 commit into
lidge-jun:devfrom
x3M3x:codex/mobile-auth-safari-password
Closed

x3M3x wants to merge 1 commit into
lidge-jun:devfrom
x3M3x:codex/mobile-auth-safari-password

Conversation

@x3M3x

@x3M3x x3M3x commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Summary

  • Let password managers treat the OpenCodex admin-token sign-in prompt as a normal username/password form.
  • Keep the existing stable account name and standard autocomplete attributes so iPhone Safari PWAs can save and autofill the admin token.

Verification

  • cd gui; bun test tests/admin-token-dialog.test.ts
  • git diff --check HEAD^ HEAD

Checklist

  • Scope stays focused and avoids unrelated cleanup.
  • Docs or release notes were updated when needed (not needed: this is a standards-compliance fix to an existing prompt).
  • Security-sensitive changes were reviewed for secrets, auth, and unsafe defaults.

Summary by CodeRabbit

  • Bug Fixes
    • The username field in the admin token dialog is now editable while remaining pre-filled with “OpenCodex.”

Review readiness checklist

This PR stays in draft until every box below is ticked. Tick all four boxes once the requirements are met:

  • All CI tests are green on my local testing.

  • I pushed my PR to the latest dev commit.

  • I resolved all correct Codex and CodeRabbit findings.

  • My PR is ready for review.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

✅ Deterministic PR hygiene checks passed.

@coderabbitai

coderabbitai Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Team

Run ID: dc053767-d5c5-4c52-9ee6-f3457edfe28b

📥 Commits

Reviewing files that changed from the base of the PR and between 8a0c108 and b7fc6b1.

📒 Files selected for processing (2)
  • gui/src/admin-token-dialog.ts
  • gui/tests/admin-token-dialog.test.ts
💤 Files with no reviewable changes (1)
  • gui/src/admin-token-dialog.ts

Included review availability: Your plan provides up to 10 included reviews per hour; 9 remain after this review.


📝 Walkthrough

Walkthrough

The admin token dialog now keeps the OpenCodex username pre-filled while allowing edits. The test now expects the username input to have readOnly set to false.

Changes

Admin token username editing

Layer / File(s) Summary
Username editability validation
gui/src/admin-token-dialog.ts, gui/tests/admin-token-dialog.test.ts
The username input is editable instead of read-only. The test assertion now expects readOnly to be false.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Merge Risk: ⚪ Minimal · up to b7fc6

The admin sign-in dialog supports an editable pre-filled username for password-manager compatibility, with no current merge-blocking risk identified.

Suggested reviewers: mincia1110

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: making the admin-token prompt compatible with password managers.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1…
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 1 files.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot added the bug Something isn't working label Sep 3, 2026
@github-actions

github-actions Bot commented Sep 3, 2026 •

Copy link
Copy Markdown
Contributor

⏳ DRAFT

  • UI screenshot required.

What to do

  • Add a screenshot of the UI change to the PR description.
  • Tick all four boxes in the PR description once you're done (currently 0/4).

Review readiness checklist

  • ⬜ All CI tests are green on my local testing.
  • ⬜ I pushed my PR to the latest dev commit.
  • ⬜ I resolved all correct Codex and CodeRabbit findings.
  • ⬜ My PR is ready for review.

0/4 boxes ticked.

This pull request was already a draft. Its draft status will be preserved after every issue above is resolved.
@x3M3x Tick the boxes once your local CI is green, your branch is on the latest dev commit, and every correct Codex and CodeRabbit finding is resolved.

@github-actions
github-actions Bot marked this pull request as draft September 3, 2026 17:37
@lidge-jun

Copy link
Copy Markdown
Owner

리뷰 · 우선순위 61 / 80

이 PR은 OpenCodex 관리 토큰 로그인 창을, 아이폰 사파리 PWA를 포함한 비밀번호 관리기가 “진짜 로그인 폼”으로 저장할 수 있게 만듭니다. 지금 dev HEAD(664d80c76)의 gui/src/admin-token-dialog.ts를 보면 이미 표준 로그인 폼입니다. username 칸은 이름 username, autocomplete="username", 값은 고정 문자열 OpenCodex이고, password 칸은 autocomplete="current-password"입니다. 주석도 “브라우저가 저장·자동완성을 제안하도록 진짜 로그인 폼을 쓴다. OpenCodex 자체는 토큰을 메모리에만 둔다”고 적혀 있습니다. 그런데 그 username 칸에 readOnly = true가 붙어 있습니다. 사파리·일부 비밀번호 관리기는 읽기 전용 사용자 이름 칸이 있으면 저장을 거부합니다. 그래서 폼 모양은 맞는데 아이폰 PWA에서는 토큰이 안 남는 상태가 됩니다.

고치는 내용은 그 readOnly = true 한 줄을 지우는 것입니다. 제출 핸들러는 원래 password.value.trim()만 검증기에 넘기고 username 값은 쓰지 않습니다. 사용자가 칸을 고쳐도 OpenCodex 인증 결과는 달라지지 않습니다. 비밀번호 관리기만 그 칸을 계정 이름으로 기억합니다. 테스트 gui/tests/admin-token-dialog.test.ts는 같은 폼이 안정 id·Account 라벨·autocomplete를 유지하면서 readOnly가 false인지만 바꿉니다. types.ts / config.ts 분할과 무관하고, 시크릿을 디스크에 쓰지 않는 기존 계약을 건드리지 않습니다.

알아 둘 점은, 칸이 편집 가능해지면 사람이 OpenCodex를 지우고 빈 값이나 다른 이름을 넣을 수 있다는 것입니다. OpenCodex는 그 값을 안 읽으므로 로그인 자체는 깨지지 않지만, 비밀번호 관리기가 엉뚱한 계정 이름으로 저장할 수는 있습니다. 아이폰에서 저장이 되려면 편집 가능해야 한다는 본문 설명이 설득력 있고, 범위도 한 줄이라 따로 숨김 트릭을 넣을 필요는 없어 보입니다. 기본값이 여전히 OpenCodex라 손을 안 대면 예전과 같은 계정 이름으로 저장됩니다.

gui/src/admin-token-dialog.ts 57행 (username.readOnly = true) - 사파리 PWA가 이 속성 때문에 토큰 저장을 거부합니다. 이 PR이 이 줄을 제거합니다.

gui/src/admin-token-dialog.ts 108행 근처 (password.value.trim()만 verify) - username은 인증에 쓰이지 않으므로 편집 가능하게 해도 서버 계약은 그대로입니다.

gui/tests/admin-token-dialog.test.ts - readOnly가 false이고 값은 여전히 OpenCodex인지 잠급니다. 회귀 범위가 맞습니다.

메인테이너의 판단이 필요한 지점

  • username을 완전히 열어 둘지, 보이기만 하고 포커스 시에만 편집 가능하게 할지. 이번 한 줄 수정으로 충분한지.
  • 아이폰 사파리 PWA에서 실제로 저장·자동완성이 되는지 한 번 확인할지.

너의 추천
범위가 작고 기존 토큰-메모리-only 계약을 깨지 않습니다. 머지하세요. 가능하면 머지 전이나 직후 아이폰 PWA에서 저장이 되는지만 한 번 보면 됩니다.

이 댓글은 grok-bot이 작성했습니다

@x3M3x
x3M3x force-pushed the codex/mobile-auth-safari-password branch from b7fc6b1 to 44d1851 Compare September 3, 2026 20:03
@x3M3x x3M3x closed this Sep 3, 2026
@x3M3x
x3M3x deleted the codex/mobile-auth-safari-password branch September 3, 2026 20:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants