All Projects → carlospliego → sails-token-auth-setup

carlospliego / sails-token-auth-setup

Licence: other
Token based authentication installation guide

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to sails-token-auth-setup

angular2-sails
An angular module for using the sails socket.io api in angular2 (@angular)
Stars: ✭ 37 (+54.17%)
Mutual labels:  sailsjs, sails
sails-hook-multitenant
A multitenant Sails.js 1.X hook for Waterline ORM.
Stars: ✭ 15 (-37.5%)
Mutual labels:  sailsjs, sails
tcome
NodeJS & Angular4 Blog
Stars: ✭ 56 (+133.33%)
Mutual labels:  sails
lingtypology
R package for linguistic cartography and typological databases search
Stars: ✭ 47 (+95.83%)
Mutual labels:  sails
Awesome Cheatsheets
👩‍💻👨‍💻 Awesome cheatsheets for popular programming languages, frameworks and development tools. They include everything you should know in one single file.
Stars: ✭ 26,007 (+108262.5%)
Mutual labels:  sailsjs
douMiBlog-Sailsjs
豆米博客-Sailsjs版,个人博客系统,使用SailsJs,MongoDb,Bootstrap,marked,SASS,swig等
Stars: ✭ 22 (-8.33%)
Mutual labels:  sailsjs
sp-sails-chat
Sails.js Chat Project tutorial for Sitepoint
Stars: ✭ 20 (-16.67%)
Mutual labels:  sailsjs
express-mvc
A light-weight mvc pattern for express framework with minimum dependencies
Stars: ✭ 23 (-4.17%)
Mutual labels:  sailsjs
sails-jwt-login
How to implement login with JWT (JSON Web Tokens) in Sails 1.0
Stars: ✭ 18 (-25%)
Mutual labels:  sailsjs
sails-inverse-model
Generate views, models and controllers for SailsJS from MySQL, PostgreSQL and MongoDB
Stars: ✭ 51 (+112.5%)
Mutual labels:  sailsjs
sails-hook-swagger-generator
A tool to help generate Swagger specification documentation based on OAS 3.0 for Sails APIs
Stars: ✭ 71 (+195.83%)
Mutual labels:  sailsjs
sails-hook-flash
Flash message for Sails applications
Stars: ✭ 14 (-41.67%)
Mutual labels:  sails
sails-react-webpack
A Sails, React & Webpack scaffolding CLI
Stars: ✭ 52 (+116.67%)
Mutual labels:  sails

#SailsJs Token Based Authentication Setup

Globals

$ npm install -g sails

Create a sails app

$ sails new myApp
$ cd myApp

Files

1 ) Copy every file to its corresponding folder

2 ) Add this to config/policies.js

'*': "hasToken",
UserController: {
    "create": true
},
AuthController: {
    '*': true
}

3 ) Change the value of config/tokenSecret.js

Install Dependencies

$ npm install --save passport
$ npm install --save passport-local
$ npm install --save bcrypt-nodejs
$ npm install --save jsonwebtoken
$ npm install --save express-jwt

Endpoints

Create user

POST user/

Login

POST auth/login

Logout

DELETE auth/logout

Validate Token

POST auth/validate_token
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].