Skip to content

Instantly share code, notes, and snippets.

@BrunoBernardino
Last active November 13, 2017 17:37
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 BrunoBernardino/bd9495aa54575bdaec64e0b41f5fd71e to your computer and use it in GitHub Desktop.
Save BrunoBernardino/bd9495aa54575bdaec64e0b41f5fd71e to your computer and use it in GitHub Desktop.
Webtask for api-header auth.
module.exports = function(context, cb) {
if (!context.headers['x-api-key']) {
return cb(401, 'Unauthorized');
}
cb(null, {
authenticated: true,
user: 'user',
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment