simple-htpasswd-auth

authenticate with htpasswd files

Usage no npm install needed!

<script type="module">
  import simpleHtpasswdAuth from 'https://cdn.skypack.dev/simple-htpasswd-auth';
</script>

README

htpasswd-auth Build Status

read/write htpasswd files

Setup

npm install --save simple-htpasswd-auth

Checking if a password is valid

const htpasswd = require('htpasswd-auth')
const file = fs.readFileSync('./path-to-htpasswd')

htpasswd.authenticate('username', 'password', file)
  .then(function (auth) {
    // auth is true if the password is valid
  })