How to use the wpcom-proxy-request.reloadProxy function in wpcom-proxy-request

To help you get started, we’ve selected a few wpcom-proxy-request examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Automattic / wp-calypso / client / lib / wpcom-undocumented / lib / me.js View on Github external
client_id: config( 'wpcom_signup_id' ),
		client_secret: config( 'wpcom_signup_key' ),
	};

	const args = {
		path: '/me/social-login/connect',
		body: body,
	};

	/*
	 * Before attempting the social connect, we reload the proxy.
	 * This ensures that the proxy iframe has set the correct API cookie,
	 * particularly after the user has logged in, but Calypso hasn't
	 * been reloaded yet.
	 */
	require( 'wpcom-proxy-request' ).reloadProxy();

	this.wpcom.req.post( { metaAPI: { accessAllUsersBlogs: true } } );

	return this.wpcom.req.post( args, fn );
};
UndocumentedMe.prototype.preferences = MePreferences;
github Automattic / wp-calypso / client / lib / wpcom-undocumented / lib / me.js View on Github external
client_id: config( 'wpcom_signup_id' ),
		client_secret: config( 'wpcom_signup_key' ),
	};

	const args = {
		path: '/me/social-login/connect',
		body: body,
	};

	/*
	 * Before attempting the social connect, we reload the proxy.
	 * This ensures that the proxy iframe has set the correct API cookie,
	 * particularly after the user has logged in, but Calypso hasn't
	 * been reloaded yet.
	 */
	require( 'wpcom-proxy-request' ).reloadProxy();

	this.wpcom.req.post( { metaAPI: { accessAllUsersBlogs: true } } );

	return this.wpcom.req.post( args, fn );
};

wpcom-proxy-request

Proxied cookie-authenticated REST API requests to WordPress.com.

GPL-2.0
Latest version published 23 days ago

Package Health Score

90 / 100
Full package analysis

Popular wpcom-proxy-request functions