From 0bc007aeb88b12aa6d865918a8c9547bf0ceae4a Mon Sep 17 00:00:00 2001 From: josh <144584931+dancer@users.noreply.github.com> Date: Sun, 21 Sep 2025 12:57:38 +0100 Subject: [PATCH] auth fixes (#1228) --- app/(chat)/api/chat/route.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/(chat)/api/chat/route.ts b/app/(chat)/api/chat/route.ts index 63827cb..98da4a1 100644 --- a/app/(chat)/api/chat/route.ts +++ b/app/(chat)/api/chat/route.ts @@ -140,7 +140,7 @@ export async function POST(request: Request) { titleError.message?.includes('No authentication provided') || titleError.message?.includes('AI Gateway requires a valid credit card')) ) { - throw titleError; + return new ChatSDKError('bad_request:activate_gateway').toResponse(); } console.warn('Title generation failed, using default:', titleError); }