A simple authentication layer for token auth
npm install --save @wdalmut/token-auth
token((token) => {
return Promise.resolve({id: 1, ...})
})(res)
// just an example
const fromDB = (token) => {
return User.find(/*...*/),
};
auth(token(fromDb))