passwordless-knexstore
v0.0.2
Published
Passwordless.js tokenstore using Knex.js
Downloads
4
Readme
passwordless-knexstore
A Passwordless TokenStore impleentation using Knex.js
Installation
npm install passwordless-knexstore
Usage
Create a Knex Table with following properties:
token
string (unique)uid
string (unique)ttl
timestamporigin
string
For example, create a knex migration using this command:
./node_modules/.bin/knex migrate:make passwordless
and add schema creation to the migration:
knex.schema.createTable('passwordless', function(table) {
table.increments('id').primary();
table.string('token').unique();
table.string('uid').unique();
table.timestamp('ttl');
table.string('origin');
});
Initialize store, passing a knex object to it:
var KnexStore = require('passwordless-knexstore');
passwordless.init(new KnexStore(knex));
Author
Forked from passwordless-bookshelfstore by Niklas Närhinen [email protected].
License
The MIT license