Skip to content

Instantly share code, notes, and snippets.

@glennblock
Last active October 24, 2017 15:34
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 glennblock/8c573e53fd40d184ac87a417625605ed to your computer and use it in GitHub Desktop.
Save glennblock/8c573e53fd40d184ac87a417625605ed to your computer and use it in GitHub Desktop.
zerocrm-compiler.js
const Authz = require('auth0-ext-compilers/lib/authorization');
const Factory = require('auth0-ext-compilers/lib/compilers/compilerFactory');
const Generic = require('auth0-ext-compilers').generic;
module.exports = Factory.createCompiler(zeroCRMHandler);
function zeroCRMHandler(func, ctx, cb) {
Authz.is_authorized(ctx, err => {
if (err) return cb(err);
func.secrets = ctx.secrets;
func.meta = ctx.meta;
return func(ctx.body, cb);
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment