-
Notifications
You must be signed in to change notification settings - Fork 96
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
Update Lock, Auth0.js; add setting to use default #635
Conversation
e139c1a
to
0906209
Compare
0906209
to
917df13
Compare
@@ -95,7 +95,6 @@ public function install_db( $version_to_install = null, $app_token = '' ) { | |||
// Plugin version < 3.4.0 | |||
if ( $this->current_db_version < 15 || 15 === $version_to_install ) { | |||
$options->set( 'cdn_url', WPA0_LOCK_CDN_URL ); | |||
$options->set( 'auth0js-cdn', WPA0_AUTH0_JS_CDN_URL ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting removed, no need to migrate anything.
@@ -130,10 +129,6 @@ public function install_db( $version_to_install = null, $app_token = '' ) { | |||
$options->set( 'cdn_url', WPA0_LOCK_CDN_URL ); | |||
} | |||
|
|||
if ( '//cdn.auth0.com/js/auth0/9.0.0/auth0.min.js' === $options->get( 'auth0js-cdn' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting removed, no need to migrate anything.
@@ -270,9 +265,6 @@ public function install_db( $version_to_install = null, $app_token = '' ) { | |||
$options->set( 'extra_conf', json_encode( $lock_json_decoded ) ); | |||
} | |||
|
|||
// Set passwordless_cdn_url to latest Lock |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Setting removed, no need to migrate anything.
@@ -619,7 +619,7 @@ public function auth0_sso_footer( $previous_html ) { | |||
return $previous_html; | |||
} | |||
|
|||
wp_enqueue_script( 'wpa0_auth0js', $this->a0_options->get( 'auth0js-cdn' ) ); | |||
wp_enqueue_script( 'wpa0_auth0js', apply_filters( 'auth0_sso_auth0js_url', WPA0_AUTH0_JS_CDN_URL ) ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filter to allow changing the URL if needed.
@@ -128,7 +128,7 @@ protected function coo_fallback() { | |||
var auth0 = new auth0.WebAuth({clientID:"%s",domain:"%s",redirectUri:"%s"}); | |||
auth0.crossOriginAuthenticationCallback(); | |||
</script></head><body></body></html>', | |||
esc_url( $this->a0_options->get( 'auth0js-cdn' ) ), | |||
esc_url( apply_filters( 'auth0_coo_auth0js_url', WPA0_AUTH0_JS_CDN_URL ) ), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Filter to allow changing the URL if needed.
// 3.10.0 | ||
if ( ( $this->current_db_version < 21 && 0 !== $this->current_db_version ) || 21 === $version_to_install ) { | ||
|
||
if ( 'https://cdn.auth0.com/js/lock/11.5/lock.min.js' === $options->get( 'cdn_url' ) ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice automagical upgrade for existing users 👍
Changes
v11.5
tov11.14
v9.4
tov9.10
auth0js-cdn
,cdn_url_legacy
,passwordless_cdn_url
WP_Auth0_Options::get_lock_url()
to get the correct Lock CDN URL based on the new setting.auth0_coo_auth0js_url
andauth0_sso_auth0js_url
to allow overriding the Auth0.js URL based on context used.cdn_url
to make sure we have a valid URL to use.Custom URL off
Custom URL on
References
Testing
Manual testing:
On a new install ...
https://cdn.auth0.com/js/lock/11.9/lock.min.js
wp-login.php
page for your siteChecklist