From d6166a058b8317190d5fdcc191d88403fa417a14 Mon Sep 17 00:00:00 2001 From: Stan Wohlwend Date: Sat, 20 Apr 2024 16:04:50 +0200 Subject: [PATCH] Improve 403 error messages --- packages/stack-server/src/app/api/v1/current-user/route.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/stack-server/src/app/api/v1/current-user/route.tsx b/packages/stack-server/src/app/api/v1/current-user/route.tsx index d1b82ab65..b30d0b087 100644 --- a/packages/stack-server/src/app/api/v1/current-user/route.tsx +++ b/packages/stack-server/src/app/api/v1/current-user/route.tsx @@ -85,7 +85,7 @@ const handler = deprecatedSmartRouteHandler(async (req: NextRequest) => { let user; if (server === "true") { if (!skValid && !asValid) { - throw new StatusError(StatusError.Forbidden); + throw new StatusError(StatusError.Forbidden, "Secret server key is invalid"); } user = await updateServerUser( projectId, @@ -100,7 +100,7 @@ const handler = deprecatedSmartRouteHandler(async (req: NextRequest) => { ); } else { if (!pkValid && !asValid) { - throw new StatusError(StatusError.Forbidden); + throw new StatusError(StatusError.Forbidden, "Publishable client key is invalid"); } user = await updateClientUser(