fix: sign重置密码读token错误
This commit is contained in:
@@ -206,7 +206,7 @@ module.exports = {
|
|||||||
changePasswd: inject(function (SysConfig) {
|
changePasswd: inject(function (SysConfig) {
|
||||||
const { PWD_HASH_SALT } = SysConfig;
|
const { PWD_HASH_SALT } = SysConfig;
|
||||||
return async (req, res) => {
|
return async (req, res) => {
|
||||||
const { userId } = res.locale.user;
|
const { userId } = res.locals.user;
|
||||||
const { password, newPassword } = req.body;
|
const { password, newPassword } = req.body;
|
||||||
const user = User.findById(userId);
|
const user = User.findById(userId);
|
||||||
if (!user || user.password !== Crypto.hash(password, { salt: PWD_HASH_SALT }))
|
if (!user || user.password !== Crypto.hash(password, { salt: PWD_HASH_SALT }))
|
||||||
|
|||||||
Reference in New Issue
Block a user