Skip to content

feat(login): gh-auth-token tip for preview auth + WONTFIX custom preview domain#537

Merged
pedrovezzadev merged 2 commits into
mainfrom
docs/pat-preview-auth-tooltip
Jun 2, 2026
Merged

feat(login): gh-auth-token tip for preview auth + WONTFIX custom preview domain#537
pedrovezzadev merged 2 commits into
mainfrom
docs/pat-preview-auth-tooltip

Conversation

@pedrovezzadev
Copy link
Copy Markdown
Contributor

@pedrovezzadev pedrovezzadev commented Jun 2, 2026

What

  • Login page: an info-icon (ⓘ) tooltip next to the Personal Access Token field — "Tip: paste the output of gh auth token". The PAT field already accepts gho_ tokens, so the GitHub CLI token works pasted verbatim, no PAT to mint.
  • Docs: mark migration task 2.6 WONTFIX and document the PAT field as the supported preview-auth path.

Why

Cloudflare hard-locks preview URLs to *.workers.dev and won't map a custom *.codjiflo.net preview domain. On a workers.dev origin the cross-subdomain OAuth flow can't complete (host-only PKCE cookies + isValidReturnOrigin() rejects the origin). The PAT field is origin-independent (validateToken only calls api.github.com/rate_limit), so it's the clean way to authenticate on a preview — and gh auth token output drops straight in.

Files
  • src/app/login/page.tsxTooltipTrigger + Info icon next to the PAT label
  • src/components/ui/index.ts — re-export Tooltip/TooltipTrigger
  • src/styles/shared/controls.css.label-with-tip / .field-tip*
  • openspec/specs/authentication/architecture.md — new "Preview-Environment Auth (PAT path)" section; corrected the stale pr-{n}.codjiflo.net claim
  • openspec/changes/migrate-deploy-to-cloudflare/{tasks,design}.md — 2.6 WONTFIX + resolved notes
  • src/app/login/page.integration.test.tsx — new test (red→green across the two commits)

Test

Two commits: the first adds the test (fails — tip button not found), the second adds the code (passes). npm run test:all green locally (1534 unit, 121 e2e mock, 31 storybook).

🤖 Generated with Claude Code


🔍 Review in CodjiFlo

pedropaulovc and others added 2 commits June 1, 2026 21:27
Renders the login page with dev auto-login disabled, reveals the PAT
section, and asserts an info-icon tooltip pointing at `gh auth token`
appears next to the field.

Fails at this commit (product code not yet added):
  TestingLibraryElementError: Unable to find an accessible element with
  the role "button" and name /Tip: paste the output of gh auth token/i

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…ew domain

Adds an accessible info-icon tooltip next to the Personal Access Token
field on the login page: "Tip: paste the output of gh auth token".
The PAT field already accepts gho_ tokens, so the gh CLI token works
verbatim — handy on PR previews, where OAuth can't complete.

Why: Cloudflare hard-locks preview URLs to *.workers.dev and won't map a
custom *.codjiflo.net preview domain (migration task 2.6 WONTFIX). On a
workers.dev origin the cross-subdomain OAuth flow can't complete (host-only
PKCE cookies + isValidReturnOrigin rejects the origin). The PAT field is
origin-independent (validateToken only hits api.github.com), so it is the
supported preview-auth path.

- Re-export Tooltip/TooltipTrigger from @/components/ui (react-aria)
- .label-with-tip / .field-tip(-trigger) styles in controls.css
- Document the PAT preview-auth path in authentication/architecture.md
  (new "Preview-Environment Auth" section; correct the stale
  pr-{n}.codjiflo.net claim) and resolve task 2.6 + design.md notes

Test from the prior commit now passes (red→green).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@pedrovezzadev pedrovezzadev enabled auto-merge June 2, 2026 04:29
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

CodjiFlo Iteration Tracking

Iterations captured: 1
Last updated: 2026-06-02T04:29:58.000Z
Artifact: 7349006651
Run ID: 26798450654


What is this?

This comment is automatically updated by the CodjiFlo GitHub Action to enable force-push resilient code review with iteration tracking.

The artifact referenced above contains iteration data that the CodjiFlo frontend uses to:

  • Track code changes across force-pushes
  • Enable comment persistence across code modifications
  • Allow comparison between any two iterations

@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
codjiflo faed7a9 Commit Preview URL

Branch Preview URL
Jun 02 2026, 04:30 AM

@github-actions
Copy link
Copy Markdown

github-actions Bot commented Jun 2, 2026

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 77.33% (🎯 70%)
⬆️ +0.03%
3235 / 4183
🔵 Statements 76.05% (🎯 70%)
⬆️ +0.08%
3392 / 4460
🔵 Functions 75.44% (🎯 70%)
⬇️ -0.21%
682 / 904
🟡 Branches 71.47% (🎯 70%)
⬇️ -0.27%
1914 / 2678
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
src/app/login/page.tsx 59.37% 46.42% 37.5% 59.37% 29, 33-40, 46-48, 53, 59-68, 196-209
Generated in workflow #1340 for commit faed7a9 by the Vitest Coverage Report Action

@pedrovezzadev pedrovezzadev merged commit 7b45973 into main Jun 2, 2026
11 checks passed
@pedrovezzadev pedrovezzadev deleted the docs/pat-preview-auth-tooltip branch June 2, 2026 04:32
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.

2 participants