0.1.9 • Published 5 years ago

@g4br13l/basic-auth v0.1.9

Weekly downloads
21
License
MIT-0
Repository
-
Last release
5 years ago

Basic-Auth to be used with Express.js

Build Status Coverage Status Dependencies

https://nodei.co/npm/@g4br13l/basic-auth.png?downloads=true&downloadRank=true&stars=true

How to install

  npm i @g4br13l/basic-auth

How to use

const router = express.Router();

const BasicAuth = require("@g4br13l/basic-auth");
const newBasicAuth = new BasicAuth("testUser", "testPassword");

router.get("/test", newBasicAuth.protect, (req, res, next) => res.status(200).send());

module.exports = router;

Responses

Matching Credentials

StatusCode: 200

Sends next() to express

Invalid credentials

StatusCode: 401

{
  "message": "Invalid Authentication Credentials"
}

No authentication provided

StatusCode: 401

{
  "message": "Missing Authorization Header"
}
0.1.8

5 years ago

0.1.9

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago