koa-accounts
v0.0.1
Published
co-accounts for Koa
Downloads
5
Maintainers
Readme
Simple authentication lib for Koa based on JSON Web Token.
Installation
$ npm install koa-accounts
Example
var koa = require('koa');
var Backend = require('koa-accounts').backendStub;
var acc = require('koa-accounts');
var app = koa();
app.accountOptions = { backend: new Backend(store), secretKey: 'shhh' };
acc(app);
app.use(function *() {
var token = yield this.acc.create('admin', 'aWeSoMePaSsWord', {});
this.body = token;
});
Running tests
$ make test
Authors
License
MIT