1.0.8 • Published 6 years ago
auth-redis-handler-nt v1.0.8
AuthRedisHandler
Module for authorization verification.
Installation
$ npm install auth-redis-handler-nt --save
## Documentation
- configure(obj)
Set configuration object before using other functions.
<b>It also set the client of Redis.</b><br> 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) Return JWT using HMAC algorithm.
- createSession(UserID, JWT Set session in Redis.
verifySession(UserID, JWT) Verify if UserID as JWT and is the same.
deleteSession(UserID) Delete JWT (session) of the UserID in Redis.