chore: org; merge consecutive await calls into one Promise.all

isekai-main
Julian Lam 3 years ago
parent 53ac159e28
commit be4dbe3441

@ -95,15 +95,18 @@ UserReset.commit = async function (code, password) {
await groups.join('verified-users', uid); await groups.join('verified-users', uid);
await groups.leave('unverified-users', uid); await groups.leave('unverified-users', uid);
} }
await user.setUserFields(uid, data);
await db.deleteObjectField('reset:uid', code); await Promise.all([
await db.sortedSetRemoveBulk([ user.setUserFields(uid, data),
['reset:issueDate', code], db.deleteObjectField('reset:uid', code),
['reset:issueDate:uid', uid], db.sortedSetRemoveBulk([
['reset:issueDate', code],
['reset:issueDate:uid', uid],
]),
user.reset.updateExpiry(uid),
user.auth.resetLockout(uid),
user.email.expireValidation(uid),
]); ]);
await user.reset.updateExpiry(uid);
await user.auth.resetLockout(uid);
await user.email.expireValidation(uid);
}; };
UserReset.updateExpiry = async function (uid) { UserReset.updateExpiry = async function (uid) {

Loading…
Cancel
Save