Skip to content

Instantly share code, notes, and snippets.

View Spomky's full-sized avatar
🚀
Stay hungry, stay foolish - SJ

Florent Morselli Spomky

🚀
Stay hungry, stay foolish - SJ
View GitHub Profile
@vktr
vktr / rule.js
Created February 10, 2018 18:54
Add Stripe Customer Id to Auth0 via custom rule
function (user, context, callback) {
user.app_metadata = user.app_metadata || {};
if ('stripe_customer_id' in user.app_metadata) {
context.idToken['https://example.com/stripe_customer_id'] = user.app_metadata.stripe_customer_id;
return callback(null, user, context);
}
var stripe = require('stripe')('sk_....');
var customer = {