Passport-based User Authentication system for Sails.js applications.
Note: For comprehensive user account control with role-based permissioning, object ownership, and row-level security, see sails-permissions, which uses this project as a dependency.
$ npm install sails-auth --save
This will install sails-auth
has a Sails.js Hook. The Hook uses
marlinspike to extend the relevant
Models, Controllers, etc.
'*': [ 'basicAuth', 'passport', 'sessionAuth' ],
AuthController: {
'*': [ 'passport' ]
}
The policies above secure everything by default, including registration. If you'd like to open registration to all users, add the following:
UserController: {
'create': true
}
Create users as you normally would (POST
to /user
). Authenticate using the
endpoint of the provider you've chosen.
Returns User
for this authenticated session.
MIT