1.0.8 • Published 6 years ago

auth-redis-handler-nt v1.0.8

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

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.

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago

1.0.0

7 years ago