【发布时间】:2020-09-18 20:49:49
【问题描述】:
当我尝试将 user._id 分配给 before 挂钩中的实体时,我变得不确定。
钩子
module.exports = (options = {}) => {
return async context => {
const user = context.params.user;
context.data = {
...
userId: user._id,
...
};
return context;
};
};
这是我的钩子寄存器
before: {
...
create: [processProperty(), authenticate('jwt')],
...
}
}
【问题讨论】:
标签: javascript express feathersjs feathers-authentication feathers-hook