1.0.9 • Published 5 years ago

@flightstats/auth-js v1.0.9

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

AuthJS

The express middleware bits for your Airframe app

This module makes it easy to integrate with Airframe auth components (yarn add @bit/cirium.airframe.core.auth)

Though there are many different Airframe apps, the way that server-side authentication happens should be the same, and AuthJS is where auth server-side implementation will be housed

Usage

Create a protected route:

  const JWTMiddleware = checkJWT();

  server.get('/api/protected', JWTMiddleware, (req, res) => {
    res.send({
      msg: 'your access token was successfully validated!',
    });
  });

Handle authorization errors:

  ...

  const jwtException = jwtErrorMiddleware();

  server.use(jwtException);

Prerequisites

Installing

Install dependencies using yarn

yarn

Versioning

We use SemVer for versioning.

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago