Skip to content

Instantly share code, notes, and snippets.

@fbaiodias
Last active June 17, 2019 12:41
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 fbaiodias/1f9703a692d7797ea1d193406d7f6afc to your computer and use it in GitHub Desktop.
Save fbaiodias/1f9703a692d7797ea1d193406d7f6afc to your computer and use it in GitHub Desktop.
Using Typeform.com account as an Auth0 Custom Social Connection
function (access_token, ctx, callback) {
request.get('https://api.typeform.com/me', {
headers: {
Authorization: 'Bearer ' + access_token,
'User-Agent': 'Auth0'
}
}, function (err, res, body) {
if (err) {
return callback(err)
}
if (res.statusCode !== 200) {
return callback(new Error('StatusCode:' + r.statusCode))
}
const profile = JSON.parse(body)
profile.user_id = profile.user_id || profile.email
profile.email_verified = true
callback(null, profile)
})
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment