fix(api, client): update Gatsby, webpack & related things (#41452)
Co-authored-by: Oliver Eyton-Williams <ojeytonwilliams@gmail.com>
This commit is contained in:
committed by
GitHub
parent
92dfb3065c
commit
ad9b1f89d8
@ -14,7 +14,7 @@ export function ensureLowerCaseEmail(profile) {
|
||||
: '';
|
||||
}
|
||||
|
||||
export default function (UserIdent) {
|
||||
export default function initializeUserIdent(UserIdent) {
|
||||
UserIdent.on('dataSourceAttached', () => {
|
||||
UserIdent.findOne$ = observeMethod(UserIdent, 'findOne');
|
||||
});
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Observable } from 'rx';
|
||||
|
||||
export default function (Block) {
|
||||
export default function initializeBlock(Block) {
|
||||
Block.on('dataSourceAttached', () => {
|
||||
Block.findOne$ = Observable.fromNodeCallback(Block.findOne, Block);
|
||||
Block.findById$ = Observable.fromNodeCallback(Block.findById, Block);
|
||||
|
@ -152,7 +152,7 @@ function populateRequiredFields(user) {
|
||||
return;
|
||||
}
|
||||
|
||||
export default function (User) {
|
||||
export default function initializeUser(User) {
|
||||
// set salt factor for passwords
|
||||
User.settings.saltWorkFactor = 5;
|
||||
// set user.rand to random number
|
||||
|
@ -1,6 +1,6 @@
|
||||
import csurf from 'csurf';
|
||||
|
||||
export default function () {
|
||||
export default function getCsurf() {
|
||||
const protection = csurf({
|
||||
cookie: {
|
||||
domain: process.env.COOKIE_DOMAIN || 'localhost',
|
||||
|
@ -1,7 +1,7 @@
|
||||
import qs from 'query-string';
|
||||
|
||||
// add rx methods to express
|
||||
export default function () {
|
||||
export default function getExpressExtensions() {
|
||||
return function expressExtensions(req, res, next) {
|
||||
res.redirectWithFlash = uri => {
|
||||
const flash = req.flash();
|
||||
|
@ -48,8 +48,11 @@ export function isAllowedPath(path, pathsAllowedREs = _pathsAllowedREs) {
|
||||
return pathsAllowedREs.some(re => re.test(path));
|
||||
}
|
||||
|
||||
export default ({ jwtSecret = _jwtSecret, getUserById = _getUserById } = {}) =>
|
||||
function requestAuthorisation(req, res, next) {
|
||||
export default function getRequestAuthorisation({
|
||||
jwtSecret = _jwtSecret,
|
||||
getUserById = _getUserById
|
||||
} = {}) {
|
||||
return function requestAuthorisation(req, res, next) {
|
||||
const { origin } = getRedirectParams(req);
|
||||
const { path } = req;
|
||||
if (!isAllowedPath(path)) {
|
||||
@ -102,3 +105,4 @@ export default ({ jwtSecret = _jwtSecret, getUserById = _getUserById } = {}) =>
|
||||
}
|
||||
return Promise.resolve(next());
|
||||
};
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Observable } from 'rx';
|
||||
|
||||
export default function (AuthToken) {
|
||||
export default function initializeAuthToken(AuthToken) {
|
||||
AuthToken.on('dataSourceAttached', () => {
|
||||
AuthToken.findOne$ = Observable.fromNodeCallback(
|
||||
AuthToken.findOne.bind(AuthToken)
|
||||
|
@ -7,7 +7,7 @@ import InMemoryCache from '../utils/in-memory-cache';
|
||||
const log = debug('fcc:boot:donate');
|
||||
const fiveMinutes = 1000 * 60 * 5;
|
||||
|
||||
export default function (Donation) {
|
||||
export default function initializeDonation(Donation) {
|
||||
let activeDonationUpdateInterval = null;
|
||||
const activeDonationCountCacheTTL = fiveMinutes;
|
||||
const activeDonationCountCache = InMemoryCache(0, reportError);
|
||||
|
@ -9,7 +9,7 @@ const failureRedirect = `${homeLocation}/signin`;
|
||||
|
||||
// TODO: can we remove passport-mock-strategy entirely in prod? That would let
|
||||
// us make passport-mock-strategy a dev dep, as it should be.
|
||||
export default {
|
||||
const passportProviders = {
|
||||
devlogin: {
|
||||
authScheme: 'mock',
|
||||
provider: 'dev',
|
||||
@ -45,3 +45,5 @@ export default {
|
||||
failureFlash: true
|
||||
}
|
||||
};
|
||||
|
||||
export default passportProviders;
|
||||
|
@ -1,19 +0,0 @@
|
||||
export default {
|
||||
bg9997c9c79feddfaeb9bdef: '56bbb991ad1ed5201cd392ca',
|
||||
bg9995c9c69feddfaeb9bdef: '56bbb991ad1ed5201cd392cb',
|
||||
bg9994c9c69feddfaeb9bdef: '56bbb991ad1ed5201cd392cc',
|
||||
bg9996c9c69feddfaeb9bdef: '56bbb991ad1ed5201cd392cd',
|
||||
bg9997c9c69feddfaeb9bdef: '56bbb991ad1ed5201cd392ce',
|
||||
bg9997c9c89feddfaeb9bdef: '56bbb991ad1ed5201cd392cf',
|
||||
bg9998c9c99feddfaeb9bdef: '56bbb991ad1ed5201cd392d0',
|
||||
bg9999c9c99feddfaeb9bdef: '56bbb991ad1ed5201cd392d1',
|
||||
bg9999c9c99feedfaeb9bdef: '56bbb991ad1ed5201cd392d2',
|
||||
bg9999c9c99fdddfaeb9bdef: '56bbb991ad1ed5201cd392d3',
|
||||
bb000000000000000000001: '56bbb991ad1ed5201cd392d4',
|
||||
bc000000000000000000001: '56bbb991ad1ed5201cd392d5',
|
||||
bb000000000000000000002: '56bbb991ad1ed5201cd392d6',
|
||||
bb000000000000000000003: '56bbb991ad1ed5201cd392d7',
|
||||
bb000000000000000000004: '56bbb991ad1ed5201cd392d8',
|
||||
bb000000000000000000005: '56bbb991ad1ed5201cd392d9',
|
||||
bb000000000000000000006: '56bbb991ad1ed5201cd392da'
|
||||
};
|
Reference in New Issue
Block a user