0.0.5-facebook-alpha-v4 • Published 7 years ago

hapi-knoc v0.0.5-facebook-alpha-v4

Weekly downloads
1
License
MIT
Repository
github
Last release
7 years ago

CAUTION: Work in progress. Not stable.

Hapi Knoc

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

Installation

npm install hapi-knoc --save
yarn add hapi-knoc

Usage

// facebook oauth
import {fb, FacebookConfig} from 'hapi-knoc';
import * as 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);
}