npm install local-auth
npm install local-auth
``
Usage:
1. add the following lines to your app.js:
``
require('local-auth')(app, express, {secret:"", ttl: 86400000})
`` NOTE that you will need app.use(require("cookie-parser")()) before this line.
2. create a .passwd file in the same dir of app.js, with the following content (split username and password by spaces):
``
admin adminpassword
user userpassword
```3. enjoy!