Skip to content
This repository has been archived by the owner on Aug 29, 2018. It is now read-only.

[MOVED] JWT authentication strategy for feathers-authentication using Passport

License

Notifications You must be signed in to change notification settings

feathersjs-ecosystem/authentication-jwt

Repository files navigation

@feathersjs/authentication-jwt

Important: The code for this module has been moved into the main Feathers repository at feathersjs/feathers (package direct link). Please open issues and pull requests there. No changes in your existing Feathers applications are necessary.

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.

About

[MOVED] JWT authentication strategy for feathers-authentication using Passport

Resources

License

Stars

Watchers

Forks

Packages

No packages published