diff --git a/web/wp-content/plugins/live-stream-gate-block/live-stream-gate-block.php b/web/wp-content/plugins/live-stream-gate-block/live-stream-gate-block.php index a4d7cf4e..e5d373c6 100644 --- a/web/wp-content/plugins/live-stream-gate-block/live-stream-gate-block.php +++ b/web/wp-content/plugins/live-stream-gate-block/live-stream-gate-block.php @@ -62,7 +62,12 @@ function lf_live_stream_gate_block_block_enqueue() wp_enqueue_script('auth0', 'https://cdn.auth0.com/js/auth0-spa-js/1.22/auth0-spa-js.production.js', array(), '1', false); - wp_enqueue_script('lf-auth0', 'https://cdn.dev.platform.linuxfoundation.org/wordpress-auth0.js', array(), '1', false); + // Use different Auth0 files depending on environment. + if ( isset( $_SERVER['PANTHEON_ENVIRONMENT'] ) && 'live' == $_SERVER['PANTHEON_ENVIRONMENT'] ) { + wp_enqueue_script( 'lf-auth0', 'https://cdn.platform.linuxfoundation.org/wordpress-auth0.js', array(), '1', false ); + } else { + wp_enqueue_script( 'lf-auth0', 'https://cdn.dev.platform.linuxfoundation.org/wordpress-auth0.js', array(), '1', false ); + } wp_enqueue_script('auth0-config', 'https://events.linuxfoundation.org/wp-content/themes/lfevents/dist/js/auth0.js', array(), '1', false); } diff --git a/web/wp-content/themes/lfevents/library/enqueue-scripts.php b/web/wp-content/themes/lfevents/library/enqueue-scripts.php index 01a276c9..ee32a1b3 100755 --- a/web/wp-content/themes/lfevents/library/enqueue-scripts.php +++ b/web/wp-content/themes/lfevents/library/enqueue-scripts.php @@ -47,7 +47,14 @@ function foundationpress_scripts() { if ( show_non_event_menu() ) { // Add auth SSO/LFX assets. wp_enqueue_script( 'auth0', 'https://cdn.auth0.com/js/auth0-spa-js/1.13.3/auth0-spa-js.production.js', array(), '1', false ); - wp_enqueue_script( 'lf-auth0', 'https://cdn.dev.platform.linuxfoundation.org/wordpress-auth0.js', array(), '1', false ); + + // Use different Auth0 files depending on environment. + if ( isset( $_SERVER['PANTHEON_ENVIRONMENT'] ) && 'live' == $_SERVER['PANTHEON_ENVIRONMENT'] ) { + wp_enqueue_script( 'lf-auth0', 'https://cdn.platform.linuxfoundation.org/wordpress-auth0.js', array(), '1', false ); + } else { + wp_enqueue_script( 'lf-auth0', 'https://cdn.dev.platform.linuxfoundation.org/wordpress-auth0.js', array(), '1', false ); + } + wp_enqueue_script( 'auth0-config', get_stylesheet_directory_uri() . '/dist/js/auth0.js', array( 'lf-auth0', 'auth0' ), filemtime( get_template_directory() . '/dist/js/auth0.js' ), false ); }