const auth = require('feathers-authentication'); const FacebookStrategy = require('passport-facebook').Strategy; const FacebookTokenStrategy = require('passport-facebook-token'); const local = require('feathers-authentication-local'); const jwt = require('feathers-authentication-jwt'); const oauth2 = require('feathers-authentication-oauth2'); module.exports = function() { const app = this; const config = app.get('auth'); app.configure(auth(config)) .configure(local()) .configure(jwt()) .configure(oauth2({ name: 'facebook', Strategy: FacebookStrategy, tokenStrategy: FacebookTokenStrategy, })); app.service('authentication').hooks({ before: { create: [ auth.hooks.authenticate('local'), ], } }); };