feathers-authentication-local

2019-09-23

feathers-authentication-local是什么

什么是feathers-authentication-local,Local authentication strategy for feathers-authentication

feathers-authentication-local使用教程帮助文档

@feathersjs/authentication-local

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.

Build Status

Local authentication strategy for feathers-authentication using Passport without all the boilerplate.

Installation

npm install @feathersjs/authentication-local --save

Quick example

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

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

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

Documentation

Please refer to the @feathersjs/authentication-local API documentationfor more details.

License

Copyright (c) 2018

Licensed under the MIT license.


上一篇:简单查商品 – Easier
下一篇:feathers-authentication-jwt
相关教程
关注微信

扫码加入 JavaScript 社区

相关文章

首次访问,需要验证
微信扫码,关注即可
(仅需验证一次)

欢迎加入 JavaScript 社区

号内回复关键字:

回到顶部