Skip to content

Instantly share code, notes, and snippets.

View djakaitis's full-sized avatar
👋

Dan djakaitis

👋
View GitHub Profile
@djakaitis
djakaitis / rule.js
Created August 28, 2019 17:45 — forked from vktr/rule.js
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 = {