Skip to content

Feature/v1 full build#3

Merged
mayur-tolexo merged 34 commits into
mainfrom
feature/v1-full-build
May 24, 2026
Merged

Feature/v1 full build#3
mayur-tolexo merged 34 commits into
mainfrom
feature/v1-full-build

Conversation

@mayur-tolexo

Copy link
Copy Markdown
Owner

No description provided.

…th optional

`make up` was failing for any dev who hadn't done the one-time GCP OAuth
client setup yet. Three changes so the binary boots out of the box:

- SHOPLIT_SESSION_SECRET: no longer hard-required. If unset, auto-generate
  a per-process random secret and log a WARN that sessions invalidate on
  restart. Production must set it explicitly.
- GOOGLE_OAUTH_CLIENT_ID / GOOGLE_OAUTH_CLIENT_SECRET: optional. When
  unset, /api/v1/auth/google and the callback return 503 with a friendly
  pointer to the runbook; the rest of the API works normally.
- Drop the dead internal/deps.go (build-tag dummy file from Task 1's
  go-mod-tidy workaround; the deps are imported for real now).

Tests reworked: only DBDSN + RedisURL are still hard-required; added
TestLoad_AutoGeneratesSessionSecret + TestLoad_DetectsGoogleOAuthConfigured.
…t/headers

Server Components ran fetch() with relative paths like "/api/v1/carts" —
Node's fetch needs absolute URLs, so SSR was crashing with
TypeError: Failed to parse URL.

Changes:
- api-client.ts: detect server vs client, prepend SHOPLIT_API_INTERNAL_URL
  (defaults to http://localhost:8080) when running in Node. Added an
  optional `cookie` parameter so server callers can forward the incoming
  request's session cookie explicitly.
- Removed next/headers import from api-client (it was breaking client
  bundles because client components import this file too).
- dashboard/page.tsx and carts/[id]/page.tsx now read cookies() at the
  page level and pass the header through to api-client calls. On 401
  they redirect to /login (server-side guard).
- (public)/page.tsx swallows the auth failure when listMyCarts 401s for
  unauthenticated visitors (the landing page should still render).
@mayur-tolexo
mayur-tolexo merged commit fdede00 into main May 24, 2026
1 of 2 checks passed
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