1.0.3 • Published 7 years ago

auth-handler-nt v1.0.3

Weekly downloads
-
License
ISC
Repository
gitlab
Last release
7 years ago

AuthHandler

Module for authorization verification.

Installation

$ yarn install auth-handler-nt --save

## Documentation

  • configure(obj) Set configuration object before using other functions. Example :
    	```json
    	{
    		"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.
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.5.1

7 years ago

0.5.0

7 years ago