Commit graph

19 commits

Author SHA1 Message Date
912cf71bb9 feat(support): Ko-fi end-to-end linking + badges (derive-on-read, no cron)
- Add Ko-fi webhook (/api/webhooks/kofi) with upsert by (provider, external_user_id)
  • Computes renews_at = timestamp + 1 calendar month + 1 day
  • Preserves first started_at; stores raw payload; canonicalizes by email when available
- Add Ko-fi claim flow
  • POST /api/support/kofi/claim/start — sends verification email via SMTP
  • GET  /api/support/kofi/claim/verify — finalizes link (sets app_user), redirects to /portal/account
  • POST /api/support/kofi/unlink — clears app_user on Ko-fi rows
- Add derive-on-read membership logic
  • /lib/memberships.ts — single source of truth for badges & “active” state
  • /api/support/badges — thin wrapper that returns per-provider badges
- Account UI
  • components/account/SupporterBadges.tsx — renders provider badges (Ko-fi now; extensible)
  • components/account/ConnectKofi.tsx — “Link Ko-fi” form (email → verify link)
  • components/account/LinkStatus.tsx — success/error banner on return
  • app/portal/account/AccountPanel.tsx — integrates badges, link panel, and banner
- Config/env
  • Requires: DIRECTUS_URL, DIRECTUS_TOKEN_ADMIN_SUPPORTER, KOFI_VERIFY_TOKEN
  • SMTP: SMTP_HOST, SMTP_PORT, SMTP_SECURE, SMTP_USER, SMTP_PASS, EMAIL_FROM
  • APP_ORIGIN used to build absolute verify URLs
- Misc
  • Fixed import to use @/lib/memberships
  • No cron required; UI derives active state via status === active && renews_at >= now

Refs: beta readiness for Ko-fi supporters
2025-10-19 17:51:04 -04:00
10767e379c prod's registration fixes 2025-10-03 11:04:08 -04:00
3796a1afd7 directus lib build fix 2025-10-02 21:16:38 -04:00
1b2d094c0c directus.ts bug fixes for bearer auth 2025-10-02 19:16:42 -04:00
ffccff85d4 sign in and register fixes for looped and forwarded pages 2025-10-02 14:42:08 -04:00
a38aa4c2f9 co2 galvo owner test 2025-10-01 20:00:26 -04:00
63ddd29393 uth(register): force “Users” role at signup; remove DIRECTUS_ROLE_MEMBER_ID override and disallow caller-provided roles 2025-09-29 14:43:42 -04:00
8aa484c16c remove unused DIRECTUS_TOKEN_SCHEMA_READ and schema helpers 2025-09-29 12:53:37 -04:00
756efbf948 migrated lib/directus.ts to user bearer from public submit 2025-09-29 12:01:08 -04:00
6e3cba4308 added Schema Bot 2025-09-29 11:10:26 -04:00
37d474d7c8 built user portal behind auth 2025-09-27 14:30:16 -04:00
514982d009 auth-cookies build error fix 2025-09-26 15:34:24 -04:00
9261fbc165 export function update 2025-09-26 12:06:59 -04:00
a6e52c5f67 small build fixes to login route and cookies 2025-09-26 12:02:27 -04:00
01c0d37d03 small directus lib patch for auth 2025-09-26 11:51:03 -04:00
5d2c668bad added basic user auth flow 2025-09-26 11:46:01 -04:00
62114470de added laser finder 2025-09-22 18:51:12 -04:00
79f0af51eb feat: update Directus API routes, add health endpoint 2025-09-22 11:28:07 -04:00
78f8d225ee Initial commit 2025-09-22 10:37:53 -04:00