var townshipAccounts = require('township-accounts')
var level = require('level')
var db = level('db')
var accounts = townshipAccounts(db, {
secret: 'not very secret'
})
var creds = {
email: '[email protected]',
password: 'weee'
}
accounts.register(creds, function (err, account) {
console.log(err, account)
})
var creds = {
email: '[email protected]',
password: 'weee'
}
accounts.login(creds, function (err, account) {
console.log(err, account)
})
accounts.logout(accountKey, function (err, account) {
console.log(err, account)
})
See more in the API documentation