Fix user id generation
This commit is contained in:
parent
a826aacbcb
commit
29292395ef
|
@ -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()}`
|
||||
}
|
||||
|
||||
|
|
|
@ -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,
|
||||
|
|
Loading…
Reference in New Issue