diff --git a/packages/server/src/utils/auth.ts b/packages/server/src/utils/auth.ts index b31e61e..fb20710 100644 --- a/packages/server/src/utils/auth.ts +++ b/packages/server/src/utils/auth.ts @@ -71,7 +71,11 @@ export function withAuthGuard( ) { return function (_: T, args: S, context: Context) { if (!context.profileId) { - throw new Error("Unauthorized"); + if (!context.spaceId) { + throw new Error("Please provide a valid API key"); + } else { + throw new Error("Unauthorized"); + } } const authContext = {