diff --git a/src/components/Avatar.svelte b/src/components/Avatar.svelte index 0450b9b..fd7c694 100644 --- a/src/components/Avatar.svelte +++ b/src/components/Avatar.svelte @@ -33,17 +33,21 @@ $: avatarSrc = src ?? imageUrl; $: status = membershipMap[normalizedPubkey]; $: isActiveMember = Boolean(status?.active) && showRing; - $: ringTierClass = - status?.tier === 'pro_kitchen' - ? 'tier-pro-kitchen' - : status?.tier === 'founders' - ? 'tier-founders' - : status?.tier === 'cook_plus' - ? 'tier-cook-plus' - : 'tier-default'; - $: ringPadding = isActiveMember ? 2.5 : 0; - $: innerSize = Math.max(16, Math.round(size - ringPadding * 2)); + $: innerSize = size; $: tooltipLabel = getMembershipLabel(status?.tier || 'unknown'); + $: glowStyle = (() => { + if (!isActiveMember) return ''; + switch (status?.tier) { + case 'founders': + return 'box-shadow: 0 0 0 2px rgba(255,215,0,0.85), 0 0 12px 4px rgba(255,215,0,0.6), 0 0 24px 8px rgba(255,215,0,0.3);'; + case 'pro_kitchen': + return 'box-shadow: 0 0 0 2px rgba(139,92,246,0.8), 0 0 12px 4px rgba(139,92,246,0.6), 0 0 24px 8px rgba(139,92,246,0.3);'; + case 'cook_plus': + return 'box-shadow: 0 0 0 2px rgba(249,115,22,0.8), 0 0 12px 4px rgba(249,115,22,0.6), 0 0 24px 8px rgba(249,115,22,0.3);'; + default: + return 'box-shadow: 0 0 0 2px rgba(249,115,22,0.8), 0 0 12px 4px rgba(249,115,22,0.6), 0 0 24px 8px rgba(249,115,22,0.3);'; + } + })(); $: if (normalizedPubkey) { queueMembershipLookup(normalizedPubkey); @@ -120,8 +124,8 @@
{ console.log('[Founders Club Lightning] Invoice created:', { receiveRequestId, amountSats, - pubkey, + pubkey: pubkey.substring(0, 16) + '...', }); // Store metadata so webhook and verify endpoints can match payment to user diff --git a/src/routes/api/genesis/verify-lightning-payment/+server.ts b/src/routes/api/genesis/verify-lightning-payment/+server.ts index 696cdee..fcd7e12 100644 --- a/src/routes/api/genesis/verify-lightning-payment/+server.ts +++ b/src/routes/api/genesis/verify-lightning-payment/+server.ts @@ -49,6 +49,16 @@ export const POST: RequestHandler = async ({ request, platform }) => { // Look up stored metadata to verify the request const kv = platform?.env?.GATED_CONTENT ?? null; + if (!kv && env.NODE_ENV === 'production') { + console.error('[Genesis Lightning] GATED_CONTENT KV binding is missing in production environment'); + return json( + { + error: 'Service unavailable', + message: 'GATED_CONTENT KV namespace is not configured' + }, + { status: 503 } + ); + } const metadata = receiveRequestId ? await getInvoiceMetadata(kv, receiveRequestId) : await getInvoiceMetadataByPaymentHash(kv, paymentHash); diff --git a/src/routes/api/membership/create-lightning-invoice/+server.ts b/src/routes/api/membership/create-lightning-invoice/+server.ts index 44b3c80..8c71a51 100644 --- a/src/routes/api/membership/create-lightning-invoice/+server.ts +++ b/src/routes/api/membership/create-lightning-invoice/+server.ts @@ -156,7 +156,7 @@ export const POST: RequestHandler = async ({ request, platform }) => { amountSats, tier, period, - pubkey, + pubkey: pubkey.substring(0, 16) + '...', }); // Store invoice metadata so webhook and verify endpoints can match payment to user diff --git a/src/routes/api/membership/verify-lightning-payment/+server.ts b/src/routes/api/membership/verify-lightning-payment/+server.ts index 7d28626..e6ed5ba 100644 --- a/src/routes/api/membership/verify-lightning-payment/+server.ts +++ b/src/routes/api/membership/verify-lightning-payment/+server.ts @@ -71,11 +71,13 @@ export const POST: RequestHandler = async ({ request, platform }) => { // Look up stored metadata to verify the request matches what was created const kv = platform?.env?.GATED_CONTENT ?? null; - - // In production, missing KV binding is a misconfiguration, not a 404 if (!kv && env.NODE_ENV === 'production') { + console.error('[Verify Lightning] GATED_CONTENT KV binding is missing in production environment'); return json( - { error: 'Service unavailable: GATED_CONTENT KV binding is missing' }, + { + error: 'Service unavailable', + message: 'GATED_CONTENT KV namespace is not configured' + }, { status: 503 } ); }