0.0.5-canary-6 • Published 6 years ago

knoc v0.0.5-canary-6

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

CAUTION: Work in progress. Not stable.

Knoc

A bell like plugin for authentication with Hapi.js, with the freedom of custom handler logic. Supports -x Facebook

Installation

npm install knoc --save
yarn add knoc

Usage

// facebook oauth
import {fb, FacebookConfig} from 'knoc';
import config '/path/to/my/config';

const fbHandler = async (req, h) => {
  const token = request.payload.token;
  // Pass in the config
  const fbConfig:FacebookConfig = config.facebook;
  return data = await fb.validate(token, fbConfig);
}