#47
Fix staging StyleX CSS for OAuth verification
Summary
- inject compiled StyleX rules into the root stylesheet loaded by SSR routes
- add an explicit production Google CTA gate for OAuth verification and launch
- document the complete Google verification recording and resubmission flow
Why
The staging login and onboarding routes loaded only the global reset/token CSS. The compiled StyleX component rules were emitted into a route chunk that those SSR pages did not preload, leaving the Gmail OAuth recording flow visibly unstyled. Google also requires the verification video to show the exact production OAuth application rather than the staging OAuth project.
Verification
pnpm test(169 passing)pnpm typecheckpnpm lint vite.config.mts lib/env.ts lib/env.test.mjs .railway/railway.tspnpm buildpnpm dlx markdownlint-cli2 docs/google-oauth-verification-demo.mdgit diff origin/main...HEAD --check- production build inspected in Dia; login screen renders with full StyleX CSS
- root CSS contains the compiled rules (
56.83 kB, 1,251 StyleX selectors)
Deployment
Merging to main should trigger the repository's configured Railway deployment.
The staging environment should be verified independently after that deployment
reaches a successful terminal state.
Activity
6mikeyreviewed2mo ago
96f46ac into main2mo ago
Review summary
No blocking correctness or security issues found. I traced the two behavior-changing pieces of this PR against their actual dependencies rather than just reading the diff:
lib/env.ts/areGoogleCtasEnabled()— the new gate (getAppUrl() !== "https://redakt.app" || GOOGLE_CTA_ENABLED === "true") is a strict-equality opt-in, so it fails closed (CTAs stay hidden) unless the operator explicitly setsGOOGLE_CTA_ENABLED=truein production. Confirmed this only controls UI CTA visibility (src/server/public.functions.ts,src/server/settings.functions.ts) — the actual OAuth route registration inlib/auth-core.tskeys offgetGoogleOAuthConfig()(client id/secret presence) and is untouched, so this change can't accidentally open an auth endpoint, only reveal/hide the button. Test coverage inlib/env.test.mjscorrectly exercises the default-off, explicit-on, staging, and missing-credentials cases, andwithEnvironment's save/restore correctly isolates state across the added blocks.vite.config.mts— verifieddevandcssInjectionTargetare real, correctly-typed options on@stylexjs/unplugin@0.19.1'sUserOptions(checked the package's shipped.d.ts), so the config won't silently no-op.cssInjectionTarget: fileName => fileName.includes("globals-")lines up withsrc/routes/__root.tsximportingglobals.css?url, matching the PR's stated goal of moving compiled StyleX rules into the root-loaded stylesheet.Non-blocking, worth confirming operationally before/at merge:
.railway/railway.tssetsGOOGLE_CTA_ENABLED: production ? preserve() : "true". SinceGOOGLE_CTA_ENABLEDis a brand-new variable, production has never had a prior value to preserve. Please confirmpreserve()on a never-before-set variable leaves it absent (safe:areGoogleCtasEnabled()staysfalse) rather than failing the IaC apply — this is the one knob that ungates the public production OAuth CTA, so it's worth being sure about ahead of the Google verification recording rather than discovering it at deploy time.Also verified:
docs/google-oauth-verification-demo.md,docs/gmail.md,README.md, and.env.exampleare internally consistent with the newGOOGLE_CTA_ENABLEDvariable and don't contradict the code.