0
我使用羽毛框架,以我的应用程序的NodeJS和我已经在下列方式如何解码jwt并从feathersjs中获取此userId?
app.service('authentication').hooks({
before: {
create: [
authentication.hooks.authenticate(config.strategies),
function (hook) {
hook.params.payload = {
userId: hook.params.user.userId,
accountId: hook.params.user.accountId
};
return Promise.resolve(hook);
}
],
remove: [
authentication.hooks.authenticate('jwt')
]
}
});
做智威汤逊的创作现在我有疑问,如何从令牌使用JWT获得用户id解码后的数据。