An open API service indexing awesome lists of open source software.

https://github.com/wdalmut/token-auth-js

Token Authentication layer for @wdalmut/mini-auth
https://github.com/wdalmut/token-auth-js

authentication express express-middleware token-authetication

Last synced: about 2 months ago
JSON representation

Token Authentication layer for @wdalmut/mini-auth

Awesome Lists containing this project

README

          

# Token Authentication layer for @wdalmut/mini-auth

A simple authentication layer for `token auth`

```
npm install --save @wdalmut/token-auth
```

## Usage

```js
token((token) => {
return Promise.resolve({id: 1, ...})
})(res)
```

### Usage with `@wdalmut/mini-auth`

```js
// just an example
const fromDB = (token) => {
return User.find(/*...*/),
};

auth(token(fromDb))
```