@feathersjs/authentication-jwt
DefinitelyTyped icon, indicating that this package has TypeScript declarations provided by the separate @types/feathersjs__authentication-jwt package

2.0.10 • Public • Published

@feathersjs/authentication-jwt

Build Status Dependency Status Download Status

JWT authentication strategy for feathers-authentication using Passport

Installation

npm install @feathersjs/authentication-jwt --save

Quick example

const feathers = require('@feathersjs/feathers');
const authentication = require('feathers-authentication');
const jwt = require('@feathersjs/authentication-jwt');
const app = feathers();

// Setup authentication
app.configure(authentication(settings));
app.configure(jwt());

// Setup a hook to only allow valid JWTs to authenticate
// and get new JWT access tokens
app.service('authentication').hooks({
  before: {
    create: [
      authentication.hooks.authenticate(['jwt'])
    ]
  }
});

Documentation

Please refer to the @feathersjs/authentication-jwt documentation for more details.

License

Copyright (c) 2018

Licensed under the MIT license.

Package Sidebar

Install

npm i @feathersjs/authentication-jwt

Weekly Downloads

1,962

Version

2.0.10

License

MIT

Unpacked Size

21.6 kB

Total Files

6

Last publish

Collaborators

  • daffl
  • marshallswain
  • alexisabril