Skip to content

Commit

Permalink
SSO updates (#937)
Browse files Browse the repository at this point in the history
Signed-off-by: James Hunt <[email protected]>
  • Loading branch information
thetwopct authored Aug 29, 2024
1 parent f97459d commit 5485837
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
9 changes: 8 additions & 1 deletion web/wp-content/themes/lfevents/library/enqueue-scripts.php
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}

Expand Down

0 comments on commit 5485837

Please sign in to comment.