1.0.1 • Published 4 years ago

lengoo-auth-validator v1.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
4 years ago

Lengoo Auth Validator

Lengoo Auth Validator is a library that allows BFF projects to interact with the authentication service and validate a given token.

The token will be first retrieved from the authentication service and then cached in Redis. The key set in Redis will expire at the same expiration date of the token itself.

Usage

Set ENV variables:

AUTH_URL=http://localhost:3000/api
REDIS_URL=redis://localhost:6379

Import as following: import { validate, InvalidTokenError, TokenExpiredError } from 'lengoo-auth-validator';

Call the function validate(token) :

  • Returns the token payload
  • Throws InvalidTokenError if token invalid (wrong format)
  • Throws TokenExpiredError if token is expired
1.0.1

4 years ago

1.0.0

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.2

4 years ago

0.0.1

4 years ago