From f67522dbbd17f849d467d607b157f8c5fddeea91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Omar=20L=C3=B3pez?= Date: Fri, 18 Jul 2025 05:21:54 -0700 Subject: [PATCH] Fix API handler response termination logic (#22575) --- apps/web/pages/api/integrations/[...args].ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/web/pages/api/integrations/[...args].ts b/apps/web/pages/api/integrations/[...args].ts index 4c2c343feb..b77c17252c 100644 --- a/apps/web/pages/api/integrations/[...args].ts +++ b/apps/web/pages/api/integrations/[...args].ts @@ -71,8 +71,8 @@ const handler = async (req: NextApiRequest, res: NextApiResponse) => { const redirectUrl = handler.redirect?.url ?? undefined; res.json({ url: redirectUrl, newTab: handler.redirect?.newTab }); } - if (!res.writableEnded) return res.status(200); - return res; + if (!res.writableEnded) res.status(200); + return; } catch (error) { console.error(error); if (error instanceof HttpError) {