Skip to content

Instantly share code, notes, and snippets.

@deedubs
Created July 8, 2015 21:23
Show Gist options
  • Select an option

  • Save deedubs/0d27ce7edc109c9c61f6 to your computer and use it in GitHub Desktop.

Select an option

Save deedubs/0d27ce7edc109c9c61f6 to your computer and use it in GitHub Desktop.
Hapi.js Auth Shim
module.exports.register = (plugin, options, next) => {
plugin.auth.scheme('shim', (server, options) => {
return {
authenticate: (request, reply) => {
return reply.continue({ credentials: { id: 123 } });
}
}
});
plugin.auth.strategy('default', 'shim', true);
next();
};
module.exports.register.attributes = {name: 'auth-shim', version: '0.0.0'};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment