Skip to content

Commit

Permalink
Return body instead of response
Browse files Browse the repository at this point in the history
  • Loading branch information
cephalization committed Nov 8, 2023
1 parent fdd9124 commit 53619fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/web/src/routes/api/party-auth/+server.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { PARTY_HOST } from '$env/static/private';
import { redirect, type RequestHandler } from '@sveltejs/kit';
import { json, redirect, type RequestHandler } from '@sveltejs/kit';

export const POST: RequestHandler = async ({ locals, request }) => {
try {
Expand All @@ -26,7 +26,7 @@ export const POST: RequestHandler = async ({ locals, request }) => {
throw new Error('Failed to authenticate');
}

return authResponse;
return json(await authResponse.json());
} catch (e) {
console.error(e);
return new Response(JSON.stringify({ error: 'Failed to authenticate' }), { status: 400 });
Expand Down

0 comments on commit 53619fc

Please sign in to comment.