From 1c5b3629ea21c62dc67885e40d260db24c7f72c2 Mon Sep 17 00:00:00 2001 From: Ian Macartney Date: Thu, 12 Dec 2024 13:33:56 -0800 Subject: [PATCH] validate default is in users table --- src/server/implementation/users.ts | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/server/implementation/users.ts b/src/server/implementation/users.ts index 884796f..548c911 100644 --- a/src/server/implementation/users.ts +++ b/src/server/implementation/users.ts @@ -62,6 +62,15 @@ async function defaultCreateOrUpdateUser( existingUserId, ...args, }); + } else { + if ( + existingUserId && + ctx.db.normalizeId("users", existingUserId) === null + ) { + throw new Error( + `User ID \`${existingUserId}\` is not in the \`users\` table`, + ); + } } const {