I want to apply a policy that lets user to login to application. I written the code for policy. I want to apply this one to homepage also.
I tried below in policies.js but its not working on homepage.
'*' : 'isLoggedIn'
I want to apply a policy that lets user to login to application. I written the code for policy. I want to apply this one to homepage also.
I tried below in policies.js but its not working on homepage.
'*' : 'isLoggedIn'
I think you are not serving your homepage through a controller/action. Policies can only be applied to content which get served via controller/action.
From the documentation of Sails Policies :
It should start working once you serve the homepage via a controller.