(uid: number, password: string)
| 296 | |
| 297 | @ArgMethod |
| 298 | static async setPassword(uid: number, password: string): Promise<Udoc> { |
| 299 | const salt = randomstring(); |
| 300 | const res = await coll.findOneAndUpdate( |
| 301 | { _id: uid }, |
| 302 | { $set: { salt, hash: await pwhash(password, salt), hashType: 'hydro' } }, |
| 303 | { returnDocument: 'after' }, |
| 304 | ); |
| 305 | deleteUserCache(res); |
| 306 | return res; |
| 307 | } |
| 308 | |
| 309 | @ArgMethod |
| 310 | static async inc(_id: number | number[], field: string, n: number = 1) { |
no test coverage detected