Skip to content

Instantly share code, notes, and snippets.

View mford22392's full-sized avatar

Madeline Ford Ryerson mford22392

View GitHub Profile
# Note: in the following sections, not every single combination of coach_recs, bookmarks and quiz_results is tested
# Essentially, coach recs, bookmarks and quiz results will always obey that order
# If one or more should not show, they just dont show, but the order of the others is unchanged
##############################
# User has no applications #
##############################
# 1. User answers 1-3 on influencer question
# 1a. No coach recs, bookmarks, or quiz results
@mford22392
mford22392 / disney-brainstorm.js
Created February 5, 2020 00:36
disney brainstorm
// eslint-disable-next-line no-unused-vars
function linkAccountsByDisneyIdAndMergeMetadata(user, context, callback) {
var request = require('[email protected]');
var async = require('[email protected]');
// This url is: https://<tenant>.auth0.com/api/v2/users
var userApiUrl = auth0.baseUrl + '/users';
// Only run this for DisneySAML users coming through the flow for the first time
// If merging is successful, identities.length will be 2+ the next time through
import * as React from 'react';
import auth0 from 'auth0-js';
const webAuth = new auth0.WebAuth({
clientID: process.env.AUTH0_CLIENT_ID || '',
domain: 'auth.guildacceptance.com',
responseType: 'token id_token',
redirectUri: window.location.href.replace('input', 'success'),
});
{
"options": {
"customScripts": {
"change_email": "function changeEmail(oldEmail, newEmail, emailVerified, callback) {var conString = configuration.DATABASE_URL || 'postgres://[email protected]:14391/guild_development';postgres(conString, function (err, client, done) {if (err) {console.log('could not connect to postgres db', err);return callback(err);}const query = 'UPDATE users SET email = $1 WHERE email = $2';client.query(query, [newEmail, oldEmail], function (err, result) {done();if (err) {console.log('error executing query', err);return callback(err);}if (result.rows.length === 0) {return callback(null);} else {var user = result.rows[0];callback(null, {id: user.uuid,email: user.email,given_name: user.first_name,family_name: user.last_name,phone_number: user.phone});}});});}",
"login": "function login(email, password, callback) {\n //this example uses the \"pg\" library\n //more info here: https://github.com/brianc/node-postgres\n\n // If you are in guild-dev, swit