ego-token-middleware

1.0.1 • Public • Published

ego-token-middleware

Express middleware for validating ego JWT

Usage

import egoToken from 'ego-token-middleware';
const app = express();
app.use(egoToken({ required: true }));

The Ego JWT must be included in in the request as authorization in either the body or the header, with the format "Bearer __TOKEN__" where __TOKEN__ is the token.

This middleware needs the request to be ran through body-parser by the consuming app.

Options

  • required - if true, send 401 error on invalid token. default: false
  • egoURL - url of ego to fetch public key from. default: the value of process.env.EGO_API

Dependents (1)

Package Sidebar

Install

npm i ego-token-middleware

Weekly Downloads

4

Version

1.0.1

License

ISC

Unpacked Size

29.8 kB

Total Files

14

Last publish

Collaborators

  • alex-wilmer
  • hlminh2000
  • jephuff
  • jgnieuwhof