sails-hook-sanpassport
About
Before use this hook you need to read sanpassport settings.
Use
Install
$ npm install sails-hook-sanpassport
Create config/passport.js
moduleexportspassport = model: "user" //optional strategyFun: null //optional ensureAuthenticated: null
Model settings
moduleexports = attributes: username: type: 'string' unique : true required : true password: type: 'string' minLength: 8 required : true { ; } ;
AuthController options
moduleexports = { // } { // } { var jsonBody = reqbody; sanpassport; }
Policies settings
moduleexportspolicies = UserController: '*': 'sessionAuth' AuthController: login: 'login' logout: 'logout' ;
Routes options
moduleexportsroutes = '/': policy: "sessionAuth" view: 'homepage' locals: layout: 'layout' 'post /login': "AuthController.login" 'post /logout': "AuthController.logout" 'post /signup': "AuthController.signup";