Skip to content

Commit

Permalink
fix: send response object in edge
Browse files Browse the repository at this point in the history
  • Loading branch information
fedeya committed Jun 28, 2023
1 parent fba852d commit 78d6165
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/credentials.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,18 @@ export const signUpHandler =
});

if (user) {
res.json({ error: 'User already exist' });
const response = { error: 'User already exist' };

if (isEdge) {
return new Response(JSON.stringify(response), {
headers: {
'Content-Type': 'application/json'
},
status: 400
});
}

res.json(response);
return;
}

Expand Down

0 comments on commit 78d6165

Please sign in to comment.