Repository navigation
Conversation
The landing and header buttons link to /api/auth/sign-in?redirect=, which ViteHub Auth serves from access.signIn, in place of a client signIn.social() call. The link works before hydration. ViteHub moves to the vite-hub/vitehub#4909 build; the comments patch for #4762 goes, since #4762 is in it.
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
There was a problem hiding this comment.
Important
The pinned Auth build puts signed-out visitors in one shared GitHub sign-in rate-limit bucket, and the UI bump changes saved comment markers and breaks a browser test. Address both before merging.
Approach: Server-rendered links are the right way to make sign-in work before hydration, but Drop should adopt a build that preserves per-client limits and keeps unrelated viewer behavior unchanged.
Reviewed changes
- Public sign-in: Traced the header and both landing links, the return path from the auth guard, and the unchanged
/signinaccount-switch flow. - ViteHub dependencies: Checked the pinned Auth route and the replacement of the local Comments patch with upstream behavior.
- Validation: Focused auth tests passed (60 passed, 2 skipped). The full suite matched PR CI: 818 passed, 3 skipped, 2 failed. The saved-area failure reproduced in isolation; the composer test passed with a longer timeout. No live GitHub OAuth round trip was run.
gpt-6.2-sol(high) | 𝕏
| "@vite-hub/realtime": "https://pkg.pr.new/vite-hub/vitehub/@vite-hub/realtime@fb731b2f91a8c608f349adf478c3e419459264b7", | ||
| "@vite-hub/schedule": "https://pkg.pr.new/vite-hub/vitehub/@vite-hub/schedule@fb731b2f91a8c608f349adf478c3e419459264b7", | ||
| "@vite-hub/ui": "https://pkg.pr.new/vite-hub/vitehub/@vite-hub/ui@fb731b2f91a8c608f349adf478c3e419459264b7", | ||
| "@vite-hub/auth": "https://pkg.pr.new/vite-hub/vitehub/@vite-hub/auth@a00c3983f0edf939dac9dc8c910e5545cd038392", |
There was a problem hiding this comment.
P1 · Class: server-started OAuth loses the trusted client address. On a production Drop, a signed-out visitor can receive 429 on their first click because three other visitors in the previous ten seconds used up the same bucket. The pinned GET handler drops the client address before handing the sign-in to Better Auth, so the previous per-client limit no longer applies to the public links.
Technical details
# Preserve per-client sign-in limits
## Affected sites
- `package.json:57` and `pnpm-workspace.yaml:9` pin the affected build.
- `server/auth.ts:103–112` enables database-backed limits outside dev and configures trusted ingress headers where applicable. Cloudflare and Deno use the address reported by the runtime instead (`shared/client-ip.ts:1–8`).
- The pinned `createSignInResponse()` constructs a new request without either source of client identity. See the [upstream finding](https://github.com/vite-hub/vitehub/pull/4909#discussion_r4612945753) and [Drop's existing ingress-address tests](https://github.com/vite-hub/drop/blob/df4d0d02e0bec3acf1daf2d297ee36a422eb3203/test/auth/client-ip.test.mjs#L53-L87).
## Required outcome
- Pin a build containing the upstream fix before switching the public links. Verify the GET route with production-style limiting: the same client hits its limit, but a different trusted client can still start sign-in.| "@vite-hub/rate-limit": "https://pkg.pr.new/vite-hub/vitehub/@vite-hub/rate-limit@a00c3983f0edf939dac9dc8c910e5545cd038392", | ||
| "@vite-hub/realtime": "https://pkg.pr.new/vite-hub/vitehub/@vite-hub/realtime@a00c3983f0edf939dac9dc8c910e5545cd038392", | ||
| "@vite-hub/schedule": "https://pkg.pr.new/vite-hub/vitehub/@vite-hub/schedule@a00c3983f0edf939dac9dc8c910e5545cd038392", | ||
| "@vite-hub/ui": "https://pkg.pr.new/vite-hub/vitehub/@vite-hub/ui@a00c3983f0edf939dac9dc8c910e5545cd038392", |
There was a problem hiding this comment.
P1 · Class: dependency upgrade changes saved-area markers. On a Markdown drop with a saved area comment, the new stylesheet draws a faint neutral border instead of the blue outline and no longer fills the area when its thread is opened. The existing browser test fails in CI and reproduces in isolation on this branch.
Technical details
# Preserve the viewer's saved-area treatment
## Affected sites
- `package.json:67` and `pnpm-workspace.yaml:42` select the new `@vite-hub/ui` stylesheet.
- [`shared/plan-runtime.ts:383–389`](https://github.com/vite-hub/drop/blob/df4d0d02e0bec3acf1daf2d297ee36a422eb3203/shared/plan-runtime.ts#L383-L389) embeds `comment-marks.css` in the frame. The new package mixes `--vh-comment-ink` at 22% for a saved area and 45% for an active area; the old rules used half-strength blue when idle and full blue with a tinted fill when active.
- [`test/viewer/margin-comments-browser.test.mjs:418–474`](https://github.com/vite-hub/drop/blob/df4d0d02e0bec3acf1daf2d297ee36a422eb3203/test/viewer/margin-comments-browser.test.mjs#L418-L474) checks both states.
## Required outcome
- Keep the existing marker behavior in this sign-in PR, either by avoiding the unrelated stylesheet bump or preserving the area styles in Drop's frame. If the marker change is intentional, review it separately rather than changing the assertion just to make this PR pass.
The "Sign in with GitHub" buttons on the landing page and in the site header called
signIn.social()in the browser, so they did nothing until the page hydrated, and a failure only showed a toast.They now link to
/api/auth/sign-in?redirect=<next>, which ViteHub Auth serves fromaccess.signIn(vite-hub/vitehub#4909). The server starts the GitHub sign-in and comes back to the page the auth guard sent the visitor from, with its own same-origin check onredirect.signin.vuekeeps its client call, since it needsprompt: select_accountto switch accounts.Depends on vite-hub/vitehub#4909. Every
@vite-hub/*package moves to that PR's pkg.pr.new build (a00c398, main plus the route). The@vite-hub/commentspatch for vite-hub/vitehub#4762 goes, since #4762 is on main now.Verified
pnpm typecheck,vp lintandpnpm fmt --checkon the changed files pass.nuxt devon this branch, signed up with email and password:GET /api/auth/sign-in?redirect=/drops/abcsigned in:302to/drops/abc. Signed out:302togithub.com/login/oauth/authorize.GET /api/auth/sign-in?redirect=//evil.example:400.GET /api/auth/sign-outwithSec-Fetch-Site: cross-site:403, session kept. Withsame-origin:303to/home, session cookies cleared,get-sessionanswersnull.href="/api/auth/sign-in?redirect=%2Fdrops%2Fabc"for/?redirect=/drops/abc, andredirect=%2Fdropsfor?redirect=//evil.example.Not verified: the GitHub round trip with a real OAuth App, and the full
pnpm testsuite.Prepared with Claude Opus 5.5 in T3 Code.