Last active
March 11, 2019 21:41
-
-
Save fsargent/26159f93a5b6d4514fff40e9be36e2ae to your computer and use it in GitHub Desktop.
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
const app = new (require('express'))(); | |
const wt = require('webtask-tools'); | |
const crypto = require('crypto'); | |
// Be sure to specify your SDK key for your environment! | |
app.get('/', (req, res) => { | |
const hmac = crypto.createHmac('sha256', req.webtaskContext.secrets.LD_SDK_KEY); | |
hmac.update(req.user.email); | |
req.user.ld_hash = hmac.digest('hex'); | |
res.setHeader('Content-Type', 'application/json'); | |
res.end(JSON.stringify(req.user)); | |
}); | |
module.exports = wt.fromExpress(app).auth0() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment