itspersonal
Uses sequelize to persist users to relational databases. Creates users, tokens and manages logins.
Import
var login = ;
Create User
//Creates a user with the given email, password, userid, first name, last name and state//The state is JSON that will be saved to the database and can contain metadata related to//the user.login{//do something with the new user object}
Create User and Token models
//Add sequelize user models to a models object that stores all your sequelize models.//The example is using a test sequelize db. var db = ;var models = {}login; { return 'database' 'username' 'password' // sqlite! now! dialect: 'sqlite' logging: false ;}
Login
login
Login with token
//Simply pass the token to loginlogin
test
npm test