javascript - Securing a page with using passport.js, sails.js and sails generate auth -


how secure page cannot accessed non authenticated user? i've read answer this question haven't been able correctly secure page sails generate auth sails.js, using passport.js.

thanks.

when generated application, sessionauth policy must have been created. example policy created when generate sails app. not part of sails-generate-auth.

to use secured routes, write configuration in config/policies.js file.

securedcontroller: {     // apply `sessionauth` policy of securedcontroller's actions     '*': 'sessionauth', }; 

sails-generate-auth populate req.session.authenticated during login sessionauth policy behave expected if correctly configured config/policies.js file.


Comments

Popular posts from this blog

javascript - Karma not able to start PhantomJS on Windows - Error: spawn UNKNOWN -

c# - Display ASPX Popup control in RowDeleteing Event (ASPX Gridview) -

Nuget pack csproj using nuspec -