diff --git a/packages/backend-core/src/db/utils.ts b/packages/backend-core/src/db/utils.ts index 7e95b7df97..dc7a0454c3 100644 --- a/packages/backend-core/src/db/utils.ts +++ b/packages/backend-core/src/db/utils.ts @@ -86,7 +86,7 @@ export function getWorkspaceParams(id = "", otherProps = {}) { * Generates a new global user ID. * @returns {string} The new user ID which the user doc can be stored under. */ -export function generateGlobalUserID(id: any) { +export function generateGlobalUserID(id?: any) { return `${DocumentTypes.USER}${SEPARATOR}${id || newid()}` } diff --git a/packages/worker/src/sdk/users/users.ts b/packages/worker/src/sdk/users/users.ts index cb2b439c7b..c2e29c7dae 100644 --- a/packages/worker/src/sdk/users/users.ts +++ b/packages/worker/src/sdk/users/users.ts @@ -108,7 +108,7 @@ export const save = async ( throw "Password must be specified." } - _id = _id || dbUtils.generateGlobalUserID(email) + _id = _id || dbUtils.generateGlobalUserID() user = { createdAt: Date.now(), ...dbUser,