Share your code.
Log in users to your Express app. The module is part of Lockit.
npm install lockit-login
var Login = ;var utils = ;var config = ;var db = utils;var adapter = config;var app = ;// express settings// ...// sessions are required - either cookie or some sort of dbapp;app;// create new Login instancevar login = config adapter;// use login.router with your appapp;// listen to events [optional]login
More about configuration at Lockit.
- two-factor authentication
- track failed log in attempts
- lock account after too many failed login attempts
- track time and ip of log ins
- redirect unauthorized users to /login and save requested url to session
- input validation
- allow login with username and/or email
- GET /login
- POST /login
- POST /login/two-factor
- GET /logout
If you've set
exports.rest in your
config.js the module behaves as follows.
- all routes have
next()ed and you can catch
/loginon the client
POST /rest/loginstays the same but sends JSON
POST /rest/login/two-factorstays the same but sends JSON
GET /rest/logoutsends JSON and you can catch
/logouton the client