https://github.com/wdalmut/basic-auth-js
Basic Auth layer for @wdalmut/mini-auth
https://github.com/wdalmut/basic-auth-js
basic-auth basic-authentication express express-middleware
Last synced: 5 months ago
JSON representation
Basic Auth layer for @wdalmut/mini-auth
- Host: GitHub
- URL: https://github.com/wdalmut/basic-auth-js
- Owner: wdalmut
- Created: 2018-03-11T10:05:38.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2018-03-11T11:11:18.000Z (almost 8 years ago)
- Last Synced: 2025-08-09T00:09:44.820Z (7 months ago)
- Topics: basic-auth, basic-authentication, express, express-middleware
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Basic Authentication layer for @wdalmut/mini-auth
A simple authentication layer for `basic auth`
```
npm install --save @wdalmut/basic-auth
```
## Usage
```js
basic((username, password) => {
return Promise.resolve({id: 1, ...})
})(res)
```
### Usage with `@wdalmut/mini-auth`
```js
// just an example
const fromDB = (username, password) => {
return User.find(/*...*/),
};
auth(basic(fromDb))
```