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

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

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))
```