This package has been deprecated

Author message:

please use the updated airframe auth module

@flightstats/auth-js

1.0.9 • Public • Published

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.

Readme

Keywords

Package Sidebar

Install

npm i @flightstats/auth-js

Weekly Downloads

1

Version

1.0.9

License

ISC

Unpacked Size

16.5 kB

Total Files

9

Last publish

Collaborators

  • flightstats