Skip to content

Instantly share code, notes, and snippets.

@chrisscott
Created March 21, 2019 18:55
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 chrisscott/9361a569a736c4c9ebabe9a127ff3080 to your computer and use it in GitHub Desktop.
Save chrisscott/9361a569a736c4c9ebabe9a127ff3080 to your computer and use it in GitHub Desktop.
Auth0 Rule - take an action for a specific `audience` in the request
function (user, context, callback) {
const audience = context.request.query.audience || false;
if ( !audience || '<API_AUDIENCE>' !== audience) {
callback(null, user, context);
}
// Do something with an authentication request that matches <API_AUDIENCE>
// ...
callback(null, user, context);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment