Expand product database to 50+ items + Feedback weight tuning (marcus/engineering#4, #5) #41

Closed
sscoble wants to merge 1 commit from feature/consolidated-fixes into main

1 commit

Author SHA1 Message Date
OpenClaw Agent
a8ed754ce8 Consolidated fix: profile fetch, affiliate env var, CORS lockdown, auth TODO
Combines fixes from PRs #34 and #35 into a clean single branch.

## Profile fetch fix (was PR #34)
- CuratedBox.js: Fetch user profile from /api/profile/:userId before
  generating box. Use actual user preferences (colors, styles, budget)
  instead of hardcoded placeholders.

## Affiliate env var fix (was PR #35)
- init-db.js, server.js: Read AMAZON_ASSOCIATE_ID from env var, fall
  back to 'greybeardhold-20'. Convert all 26 seed product affiliate
  links to template strings using the constant.
- .env.example: Add AMAZON_ASSOCIATE_ID configuration example.

## CORS lockdown
- server.js: Restrict CORS to specific origins (localhost:3000,
  wardrobe.scoble.me) instead of wildcard '*'.

## Auth TODO
- CuratedBox.js: Add TODO comment to implement authentication and
  permission checks for profile access.

## Style validation fix
- server.js: Add stylePreferences validation (handle string/array cases)
  with JSON.parse fallback in the /api/box endpoint.

## Minor fix
- server.js: Fix leading space in Pact Women's Cotton Cardigan title.
2026-05-02 17:10:34 -07:00