Skip to content

Latest commit

 

History

History
27 lines (19 loc) · 410 Bytes

README.md

File metadata and controls

27 lines (19 loc) · 410 Bytes

Basic Authentication layer for @wdalmut/mini-auth

A simple authentication layer for basic auth

npm install --save @wdalmut/basic-auth

Usage

basic((username, password) => {
  return Promise.resolve({id: 1, ...})
})(res)

Usage with @wdalmut/mini-auth

// just an example
const fromDB = (username, password) => {
  return User.find(/*...*/),
};

auth(basic(fromDb))