Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SSO updates #937

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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