I am having trouble figuring out sails policies, I follow the tutorial but still can't make it work.
In my policies.js file:
module.exports.policies = {
'*':true,
UsersController:{
'*':false,
signIn: 'skipAuthenticated'
}
}
And in my authenticated.js file:
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);
}
}
But the policy does not trigger. Any help would be really appreciated.