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