testdata.convert

This commit is contained in:
masnn committed 2020-06-13 13:33:37 +08:00
1 parent 26f780ddee
commit 0d7d6ea12a
15 files changed
+199 -127

No files matched your search

+3 -3
View File
@@ -141,7 +141,7 @@ class HomeSecurityHandler extends Handler {
for (const session of sessions) {
if (tokenDigest === md5(session._id)) {
// eslint-disable-next-line no-await-in-loop
await token.delete(session._id, token.TYPE_SESSION);
await token.del(session._id, token.TYPE_SESSION);
return this.back();
}
}
@@ -149,7 +149,7 @@ class HomeSecurityHandler extends Handler {
}
async postDeleteAllTokens() {
await token.deleteByUid(this.user._id);
await token.delByUid(this.user._id);
this.response.redirect = '/login';
}
}
@@ -200,7 +200,7 @@ class UserChangemailWithCodeHandler extends Handler {
if (udoc) throw new UserAlreadyExistError(tdoc.mail);
await Promise.all([
user.setEmail(this.user._id, tdoc.mail),
token.delete(code, token.TYPE_CHANGEMAIL),
token.del(code, token.TYPE_CHANGEMAIL),
]);
this.response.redirect = '/home/security';
}