我有一个愚蠢的问题与feathersjs auth钩子(或其他)。这是我的代码与评论:Feathersjs管理员角色(或与auth检查羽毛中间件)
app.get('/admin', function (req, res) {
// i'd like to check here if (req.connection.isAdmin) then render page
res.render('admin/admin.html', {
title: 'admin'
})
});
我找不到在哪里我可以实现用户身份验证钩为chek用户管理角色。我怎样才能做到这一点?
一些谷歌搜索后,我发现这个相同的问题https://github.com/feathersjs/feathers/issues/357但没有解决方法和页面上的链接被打破。仍然误解如何在中间件上实现钩子,或者只是使用自定义认证逻辑....如果我可以访问req,请使用连接凭证res – Victor