帆のポリシーを理解するのに問題があります。チュートリアルに従っていますが、まだ機能しません。
私のpolicies.jsファイルでは:
module.exports.policies = {
'*':true,
UsersController:{
'*':false,
signIn: 'skipAuthenticated'
}
}
そして、私の authenticated.js ファイルで:
module.exports = function skipAuthenticated(req, res, ok){
console.log("testing");
if (req.session.authenticated){
console.log("testing");
return ok();
}
else {
return res.send("You are not permitted to perform this action.", 403);
}
}
しかし、ポリシーはトリガーされません。どんな助けでも本当に感謝しています。