mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
remove server.log setting item
This commit is contained in:
1 parent
e62e7b49a3
commit
ee78271a84
27 files changed
+159
-114
No files matched your search
@@ -15,8 +15,8 @@ import { sendMail } from '../lib/mail';
|
||||
import * as misc from '../lib/misc';
|
||||
import {
|
||||
UserAlreadyExistError, InvalidTokenError, VerifyPasswordError,
|
||||
UserNotFoundError, LoginError, SystemError,
|
||||
BlacklistedError, UserFacingError,
|
||||
UserNotFoundError, SystemError, BlacklistedError,
|
||||
UserFacingError,
|
||||
} from '../error';
|
||||
|
||||
class UserLoginHandler extends Handler {
|
||||
@@ -35,7 +35,7 @@ class UserLoginHandler extends Handler {
|
||||
@param('rememberme', Types.Boolean, true)
|
||||
async post(domainId: string, uname: string, password: string, rememberme = false) {
|
||||
const udoc = await user.getByUname(domainId, uname);
|
||||
if (!udoc) throw new LoginError(uname);
|
||||
if (!udoc) throw new UserNotFoundError(uname);
|
||||
udoc.checkPassword(password);
|
||||
await user.setById(udoc._id, { loginat: new Date(), loginip: this.request.ip });
|
||||
if (udoc.priv === PRIV.PRIV_NONE) throw new BlacklistedError(uname);
|
||||
|
||||
Reference in new issue
Block a user