MCPcopy Create free account
hub / github.com/hydro-dev/Hydro / getByEmail

Method getByEmail

packages/hydrooj/src/model/user.ts:260–267  ·  view source on GitHub ↗
(domainId: string, mail: string)

Source from the content-addressed store, hash-verified

258
259 @ArgMethod
260 static async getByEmail(domainId: string, mail: string): Promise<User> {
261 const mailLower = handleMailLower(mail);
262 if (cache.has(`mail/${mailLower}/${domainId}`)) return cache.get(`mail/${mailLower}/${domainId}`);
263 const udoc = await coll.findOne({ mailLower });
264 if (!udoc) return null;
265 const dudoc = await domain.getDomainUser(domainId, udoc);
266 return initAndCache(udoc, dudoc);
267 }
268
269 @ArgMethod
270 static async setById(uid: number, $set?: Partial<Udoc>, $unset?: Value<Partial<Udoc>, ''>, $push?: any) {

Callers 15

applyFunction · 0.80
runFunction · 0.80
runFunction · 0.80
runFunction · 0.80
runFunction · 0.80
runFunction · 0.80
upgrade.tsFile · 0.80
postMethod · 0.80
getMethod · 0.80
getMethod · 0.80
postMethod · 0.80
postMethod · 0.80

Calls 4

initAndCacheFunction · 0.85
getDomainUserMethod · 0.80
handleMailLowerFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected