Skip to content

Instantly share code, notes, and snippets.

@thomasmichaelwallace
Created July 20, 2017 16:39
Show Gist options
  • Save thomasmichaelwallace/c2d71742b346c28005d479ac1bcb8181 to your computer and use it in GitHub Desktop.
Save thomasmichaelwallace/c2d71742b346c28005d479ac1bcb8181 to your computer and use it in GitHub Desktop.
An amazing example of the fun things you can do with an authorized context.
const amazing = (event, context, callback) => {
const { requestContext: { authorizer } } = event;
const body = {
hello: 'world',
authContext: authorizer,
};
const response = {
statusCode: 200,
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(body),
};
return callback(null, response);
};
module.exports = { amazing };
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment