December 2014
Intermediate to advanced
214 pages
4h 6m
English
As mentioned earlier, we use Passport to deal with user authentication in our API. Here, we will see how to use and store sessions and encrypt a user password to maintain a secure authentication.
First of all, let's install and save the Passport middleware to the application:
npm install passport passport-local --save
app express variable:// Passport configuration
require('./server/config/passport')(passport);passport.js file and the necessary code inside the config folder. We can name this file with any name. However, to demonstrate the use of the passport module, we use the same name from the module. Create ...Read now
Unlock full access