fix(*): Prevent CORS errors with subscriptions

This commit is contained in:
Josh Creek
2024-10-20 20:15:56 +01:00
parent 4c44f772e5
commit f3e6c236d5
2 changed files with 14 additions and 23 deletions
+3 -2
View File
@@ -15,8 +15,9 @@ export const POST: RequestHandler = async ({ request, cookies, locals: { safeGet
const userId = session.user.id;
const userEmail = session.user.email;
// Get the price ID from the request body
const { priceId } = await request.json();
// Get the price ID from the request form data
const formData = await request.formData();
const priceId = formData.get('priceId');
if (!priceId) {
return new Response('Price ID is required', { status: 400 });