1.0.3 • Published 7 years ago
auth-handler-nt v1.0.3
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.