Here we intend to demonstrate the procedure of local authentication i.e. by using a username and password. Step 1: Dependencies passport passport-local bcrypt List these dependencies inside application_directory/package.json under dependencies.
1 2 3 4 5 6 7 8 9 10 11 |
//application_directory/package.json { ... "dependencies": { ... "passport": "~0.1.16", "passport-local": "~0.1.6", "bcrypt": "~0.7.6" } ... } |
Step 2: Create user model To create user model run the following command:
1 |
sails generate model user |
Now the user model will be created inside the /api/models/user.js […]