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
- Host: GitHub
- URL: https://github.com/wdalmut/token-auth-js
- Owner: wdalmut
- Created: 2018-03-11T12:14:35.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-11T12:14:48.000Z (over 8 years ago)
- Last Synced: 2025-03-15T13:41:45.708Z (about 1 year ago)
- Topics: authentication, express, express-middleware, token-authetication
- Language: JavaScript
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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))
```