|
|
@ -47,6 +47,9 @@ export default class User implements UserType { |
|
|
|
'roles', |
|
|
|
'roles', |
|
|
|
'token_version' |
|
|
|
'token_version' |
|
|
|
]); |
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
insertObj.email = insertObj.email?.toLowerCase(); |
|
|
|
|
|
|
|
|
|
|
|
const { id } = await ncMeta.metaInsert2( |
|
|
|
const { id } = await ncMeta.metaInsert2( |
|
|
|
null, |
|
|
|
null, |
|
|
|
null, |
|
|
|
null, |
|
|
@ -76,6 +79,8 @@ export default class User implements UserType { |
|
|
|
'roles', |
|
|
|
'roles', |
|
|
|
'token_version' |
|
|
|
'token_version' |
|
|
|
]); |
|
|
|
]); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
updateObj.email = updateObj.email?.toLowerCase(); |
|
|
|
// get existing cache
|
|
|
|
// get existing cache
|
|
|
|
const keys = [ |
|
|
|
const keys = [ |
|
|
|
// update user:<id>
|
|
|
|
// update user:<id>
|
|
|
@ -97,7 +102,8 @@ export default class User implements UserType { |
|
|
|
// set meta
|
|
|
|
// set meta
|
|
|
|
return await ncMeta.metaUpdate(null, null, MetaTable.USERS, updateObj, id); |
|
|
|
return await ncMeta.metaUpdate(null, null, MetaTable.USERS, updateObj, id); |
|
|
|
} |
|
|
|
} |
|
|
|
public static async getByEmail(email, ncMeta = Noco.ncMeta) { |
|
|
|
public static async getByEmail(_email: string, ncMeta = Noco.ncMeta) { |
|
|
|
|
|
|
|
const email = _email?.toLowerCase(); |
|
|
|
let user = |
|
|
|
let user = |
|
|
|
email && |
|
|
|
email && |
|
|
|
(await NocoCache.get( |
|
|
|
(await NocoCache.get( |
|
|
|