Last active
November 13, 2017 17:37
-
-
Save BrunoBernardino/bd9495aa54575bdaec64e0b41f5fd71e to your computer and use it in GitHub Desktop.
Webtask for api-header auth.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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