How to use sails-auth in sails project?

北慕城南 提交于 2019-12-12 20:30:22

问题


How can I use sails-auth hook in my sails project? I installed sails-auth using npm install sails-auth --save. and when running project terminal logs says sails-auth controllers, services, models are loaded using marlinspike. But I don't have any idea about further steps. Please help me..


回答1:


sails-auth is a Passport-based User Authentication system for Sails.js applications.

When u run npm install sails-auth --save, it will install sails-auth as a Sails Hook. The Hook uses marlinspike to inject the relevant Controllers, Policies, etc into your Sails application, that why u got sails-auth controllers, services, models are loaded using marlinspike.

After installing sails-auth you should configure config/passport.js and config/auth.js.

Found a good step-by-step example here

Hope it helps.



来源:https://stackoverflow.com/questions/35194863/how-to-use-sails-auth-in-sails-project

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!