1
0
Fork 0
mirror of synced 2024-06-14 08:24:48 +12:00

Fix user id generation

This commit is contained in:
Rory Powell 2022-06-13 22:26:15 +01:00
parent a826aacbcb
commit 29292395ef
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.
* @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()}`
}

View file

@ -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,