@mkhizeryounas/authorizer

Authorizer package for nova

Usage no npm install needed!

<script type="module">
  import mkhizeryounasAuthorizer from 'https://cdn.skypack.dev/@mkhizeryounas/authorizer';
</script>

README

Authorizer

This is a authorization library for microservices architecture using JWT

Getting started

npm i @mkhizeryounas/authorizer

Initialize context

const Authorizer = require('@mkhizeryounas/authorizer');

const authorizer = new Authorizer({
  url: 'http://localhost:8090/user/',
});

Use in an express route

router.get(
  '/protected-route',
  authorizer.middleware,
  async (res, res, next) => {
    res.send('OK');
  }
);

Contributing

Feel free to submit pull requests.

Authors

Khizer Younas - Initial work - mkhizeryounas

Licensing

The project is MIT Licenced.