0.0.2 • Published 9 years ago

passwordless-knexstore v0.0.2

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

Build Status

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 timestamp
  • origin 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 niklas@narhinen.net.

License

The MIT license