Skip to content

Instantly share code, notes, and snippets.

@mingder78
Created September 4, 2017 01:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mingder78/c57a1175f7bb9f3069c7a0bc0036e482 to your computer and use it in GitHub Desktop.
Save mingder78/c57a1175f7bb9f3069c7a0bc0036e482 to your computer and use it in GitHub Desktop.
hapi collection
'use strict';
// Load modules
const Boom = require('boom');
const Hoek = require('hoek');
const Joi = require('joi');
// Declare internals
const internals = {};
exports.register = function (server, options, next) {
server.auth.scheme('cookie', internals.implementation);
next();
};
exports.register.attributes = {
pkg: require('../package.json')
};
@mingder78
Copy link
Author

mingder78 commented Sep 4, 2017

'use strict';

// Load modules

const Boom = require('boom');
const Hoek = require('hoek');

// Declare internals

const internals = {};

exports.register = function (plugin, options, next) {

plugin.auth.scheme('basic', internals.implementation);
next();

};

exports.register.attributes = {
pkg: require('../package.json')
};

internals.implementation = function (server, options) {
const scheme = {
authenticate: function (request, reply) {
}
}
return scheme;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment