feathers-authentication-hooks-apikey

0.0.2 • Public • Published

feathers-authentication-hooks-apikey

Build Status Code Climate Test Coverage

Add custom authentication to your data

Installation

npm i feathers-authentication-hooks-apikey

Documentation

TBD

Complete Example

Here's an example hook adding authentication using feathers-authentication-hooks-apikey.

const { addAuthentication } = require('feathers-authentication-hooks-apikey')
 
module.exports = {
  before: {
    find: [ addAuthentication({ secret: 'my-super-secret' }) ],
    patch: [ addAuthentication({ secret: 'my-super-secret' }) ]
  }
}

Here's an example hook checking authentication using feathers-authentication-hooks-apikey.

const { authenticateFrom } = require('feathers-authentication-hooks-apikey')
 
module.exports = {
  before: {
    // if `required: false` it will not fail if the secret is not present
    find: [ authenticateFrom({ path: 'params.query', secret: 'my-super-secret', required: false }) ]
    patch: [ authenticateFrom({ path: 'data', secret: 'my-super-secret', required: true }) ]
  }
}

License

Copyright (c) 2018

Licensed under the MIT license.

Package Sidebar

Install

npm i feathers-authentication-hooks-apikey

Weekly Downloads

67

Version

0.0.2

License

MIT

Unpacked Size

7.75 kB

Total Files

8

Last publish

Collaborators

  • mattchewone