fix role manage

This commit is contained in:
undefined committed 2020-04-27 19:07:56 +08:00
1 parent 15d43636c0
commit 42e534615e
34 files changed
+221 -314

No files matched your search

-3
View File
@@ -4,7 +4,6 @@ const token = require('../model/token');
const system = require('../model/system');
const { sendMail } = require('../lib/mail');
const misc = require('../lib/misc');
const validator = require('../lib/validator');
const options = require('../options');
const { PERM_REGISTER_USER, PERM_LOGGEDIN } = require('../permission');
const {
@@ -55,7 +54,6 @@ class UserRegisterHandler extends Handler {
}
async post({ mail }) {
validator.checkEmail(mail);
if (await user.getByEmail(mail, true)) throw new UserAlreadyExistError(mail);
this.limitRate('send_mail', 3600, 30);
const t = await token.add(
@@ -112,7 +110,6 @@ class UserLostPassHandler extends Handler {
}
async post({ mail }) {
validator.checkEmail(mail);
const udoc = await user.getByEmail(mail);
if (!udoc) throw new UserNotFoundError(mail);
const tid = await token.add(