fix token, update setting

This commit is contained in:
undefined committed 2020-07-01 22:25:50 +08:00
1 parent 1074c21c00
commit 31622bc580
4 files changed
+35 -27

No files matched your search

+1 -1
View File
@@ -39,7 +39,7 @@ class UserLoginHandler extends Handler {
}) {
const udoc = await user.getByUname(domainId, uname);
if (!udoc) throw new LoginError(uname);
if (udoc) udoc.checkPassword(password);
udoc.checkPassword(password);
await user.setById(udoc._id, { loginat: new Date(), loginip: this.request.ip });
if (udoc.priv === PRIV_NONE) throw new BlacklistedError(uname);
this.session.uid = udoc._id;