0.0.1 • Published 10 years ago

koa-accounts v0.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

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