diff --git a/src/lib/utils/supabase/admin.ts b/src/lib/utils/supabase/admin.ts index 71a9439..a5a53eb 100644 --- a/src/lib/utils/supabase/admin.ts +++ b/src/lib/utils/supabase/admin.ts @@ -1,11 +1,8 @@ import { createClient } from '@supabase/supabase-js'; import stripe from 'stripe'; import type { Database, Tables, TablesInsert } from '$types/supabase'; -import { - PUBLIC_SUPABASE_URL, - SUPABASE_SERVICE_ROLE_KEY, - PUBLIC_STRIPE_SECRET_KEY -} from '$env/static/public'; +import { PUBLIC_SUPABASE_URL, PUBLIC_STRIPE_SECRET_KEY } from '$env/static/public'; +import { SUPABASE_SERVICE_ROLE_KEY } from '$env/static/private'; const toDateTime = (secs: number) => { const t = new Date(+0); // Unix epoch start. diff --git a/src/routes/api/webhook/stripe/+server.ts b/src/routes/api/webhook/stripe/+server.ts index 9b7b70b..a74d299 100644 --- a/src/routes/api/webhook/stripe/+server.ts +++ b/src/routes/api/webhook/stripe/+server.ts @@ -82,10 +82,9 @@ export const POST: RequestHandler = async ({ request }) => { } // Return a response to acknowledge receipt of the event - return { - status: 200, - body: { received: true } - }; + return new Response(JSON.stringify({ received: true }), { + status: 200 + }); } catch (err) { console.log(`Webhook Error: ${err.message}`); return {