accountdown-token
Token authentication for accountdown
Install with npm
$ npm i accountdown-token --save
Running tests
Install dev dependencies:
$ npm i -d && npm test
Usage
var Token = ;var accountdown = ;var level = ; var db = ;var users = ; var username = 'doowb';var opts = login: token: username: username token: 'foobarbaz' value: name: 'Brian' ; users;
API
.verify
Verify that the token is correct and still valid (e.g. not expired)
Params
creds
{Object}: Credentials object containing ausername
andtoken
to validate.cb
{Function}: Callback that takeserr, ok, id
Example
login;
.create
Create a new user token for the given id and credentials.
Params
id
{String}: Identifier of the account being created.creds
{Object}: Credentials object used for creating the token.returns
{Array}: Array of rows to be added to the accountdowndatabase
Example
login;
Related projects
- accountdown: persistent accounts backed to leveldb
- level: Fast & simple storage - a Node.js-style LevelDB wrapper (a convenience package bundling LevelUP &… more
- levelup: Fast & simple storage - a Node.js-style LevelDB wrapper
- leveldown: A Node.js LevelDB binding, primary backend for LevelUP
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue
Author
Brian Woodward
License
Copyright © 2015 Brian Woodward Released under the MIT license.
This file was generated by verb-cli on July 23, 2015.