auth-handler-nt

1.0.3 • Public • Published

AuthHandler

Module for authorization verification.

Installation

$ yarn install auth-handler-nt --save

## Documentation

  • configure(obj)
    Set configuration object before using other functions.
    Example :

     {
     	"JWT_TOKEN": "TESTJWT",
     	"API_KEY": "SUPERAPIKEY"
     }
  • checkAPIKey(req, res, next)
    Middleware for API KEY checking.
    Returns error with status 401 if wrong API KEY.

  • checkJWT(req, res, next)
    Middleware for JWT checking.
    Returns error with status 401 if wrong JWT.

  • createJWT_HMAC(exp, data, JWT_TOKEN = null)
    Return JWT using HMAC algorithm. You can override the config JWT by giving another token in parameter.

Readme

Keywords

none

Package Sidebar

Install

npm i auth-handler-nt

Weekly Downloads

9

Version

1.0.3

License

ISC

Unpacked Size

4.58 kB

Total Files

4

Last publish

Collaborators

  • nicolas.garnier