Socket
Socket
Sign inDemoInstall

sails-auth

Package Overview
Dependencies
Maintainers
1
Versions
51
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sails-auth

Wrapper module for sails-generate-auth generator that includes the required dependencies


Version published
Maintainers
1
Created
Source

-auth

NPM version Build status Dependency Status

Install

$ npm install lodash sails-auth --save

Usage

1. configure .sailsrc

{
  "generators": {
    "modules": {
      "permissions-api": "sails-permissions",
      "auth-api": "sails-auth"
    }
  }
}

2. run sails generator

$ sails generate auth-api

3. update configs

config/bootstrap.js
module.exports.bootstrap = function (next) {
  ...
  sails.services.passport.loadStrategies();
  ...
  next();
};
config/http.js
module.exports.http = {
  ...
  middleware: {
    passportInit: require('sails-auth/node_modules/passport').initialize(),
    passportSession: require('sails-auth/node_modules/passport').session(),

    order: [
      ...
      'session',
      'passportInit',
      'passportSession',
      ...
    ]
  }
}
config/routes.js
module.exports.routes = {
  ...
};
_.defaults(exports.routes, require('sails-auth/config/routes'));
config/policies.js
  '*': [ 'passport', 'sessionAuth' ],

  AuthController: {
    '*': true
  }

Entities

  • Models
    • Passport
  • Controllers
    • AuthController
  • Policies
    • passport
  • Services
    • passport
    • protocols/local
    • protocols/oauth
    • protocols/oauth2
    • protocols/openid
Passport Protocols

License

MIT

Keywords

FAQs

Package last updated on 14 Feb 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc