Fix user id generation

This commit is contained in:
Rory Powell 2022-06-13 22:26:15 +01:00
parent 6b3d301fcf
commit 46d7eab105
2 changed files with 2 additions and 2 deletions

View File

@ -86,7 +86,7 @@ export function getWorkspaceParams(id = "", otherProps = {}) {
* Generates a new global user ID. * Generates a new global user ID.
* @returns {string} The new user ID which the user doc can be stored under. * @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()}` return `${DocumentTypes.USER}${SEPARATOR}${id || newid()}`
} }

View File

@ -108,7 +108,7 @@ export const save = async (
throw "Password must be specified." throw "Password must be specified."
} }
_id = _id || dbUtils.generateGlobalUserID(email) _id = _id || dbUtils.generateGlobalUserID()
user = { user = {
createdAt: Date.now(), createdAt: Date.now(),
...dbUser, ...dbUser,