Skip to content
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
6 changes: 3 additions & 3 deletions WP_Auth0.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@
/**
* Plugin Name: PLUGIN_NAME
* Description: PLUGIN_DESCRIPTION
* Version: 3.2.15
* Version: 3.2.16
* Author: Auth0
* Author URI: https://auth0.com
*/
define( 'WPA0_PLUGIN_FILE', __FILE__ );
define( 'WPA0_PLUGIN_DIR', trailingslashit( plugin_dir_path( __FILE__ ) ) );
define( 'WPA0_PLUGIN_URL', trailingslashit( plugin_dir_url( __FILE__ ) ) );
define( 'WPA0_LANG', 'wp-auth0' );
define( 'AUTH0_DB_VERSION', 12 );
define( 'WPA0_VERSION', '3.2.15' );
define( 'AUTH0_DB_VERSION', 13 );
define( 'WPA0_VERSION', '3.2.16' );

/**
* Main plugin class
Expand Down
23 changes: 17 additions & 6 deletions lib/WP_Auth0_DBManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,24 @@ public function install_db() {

if ( $this->current_db_version < 12 ) {

if ( strpos( $cdn_url, '10.' ) === false ) {
$options->set('use_lock_10', false);
} else {
$options->set('use_lock_10', true);
}
if ( strpos( $cdn_url, '10.' ) === false ) {
$options->set('use_lock_10', false);
} else {
$options->set('use_lock_10', true);
}

}
}

if ( $this->current_db_version < 13 ) {
$ips = $options->get('migration_ips');
$oldips = '138.91.154.99,54.221.228.15,54.183.64.135,54.67.77.38,54.67.15.170,54.183.204.205,54.173.21.107,54.85.173.28';

$ipCheck = new WP_Auth0_Ip_Check($options);

if ( $ips === $oldips ) {
$options->set('migration_ips', $ipCheck->get_ip_by_region('us'));
}
}

$this->current_db_version = AUTH0_DB_VERSION;
update_option( 'auth0_db_version', AUTH0_DB_VERSION );
Expand Down
6 changes: 5 additions & 1 deletion lib/WP_Auth0_Ip_Check.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
class WP_Auth0_Ip_Check {

protected $valid_webtask_ips = array(
'us' => '138.91.154.99,54.221.228.15,54.183.64.135,54.67.77.38,54.67.15.170,54.183.204.205,54.173.21.107,54.85.173.28',
'us' => '138.91.154.99,54.183.64.135,54.67.77.38,54.67.15.170,54.183.204.205,54.173.21.107,54.85.173.28,35.167.74.121,35.160.3.103,35.166.202.113,52.14.40.253,52.14.38.78,52.14.17.114,52.71.209.77,34.195.142.251,52.200.94.42',
'eu' => '52.28.56.226,52.28.45.240,52.16.224.164,52.16.193.66',
'au' => '52.64.84.177,52.64.111.197',
);
Expand All @@ -26,6 +26,10 @@ public function get_ips_by_domain( $domain ) {
return null;
}

public function get_ip_by_region($region) {
return $this->valid_webtask_ips[$region];
}

protected function get_request_ip() {
$valid_proxy_ip = $this->a0_options->get( 'valid_proxy_ip' );

Expand Down
4 changes: 2 additions & 2 deletions lib/WP_Auth0_Options.php
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ public function get_default($key) {

public function get_client_secret_as_key() {
$secret = $this->get('client_secret', '');
$isEncoded = $this->get('client_secret_b64_encoded', false);
$isEncoded = $this->get('client_secret_b64_encoded', false);
return $isEncoded ? JWT::urlsafeB64Decode($secret) : $secret;
}

Expand All @@ -58,7 +58,7 @@ protected function defaults() {
'auto_login_method' => '',
'client_id' => '',
'client_secret' => '',
'client_secret_b64_enabled' => true,
'client_secret_b64_encoded' => true,
'domain' => '',
'form_title' => '',
'icon_url' => '',
Expand Down
4 changes: 2 additions & 2 deletions lib/admin/WP_Auth0_Admin_Basic.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ public function render_client_secret() {
public function render_client_secret_b64_encoded() {
$v = absint( $this->options->get( 'client_secret_b64_encoded' ) );

echo $this->render_a0_switch( "Not Base64 Enabled", "Base64 Enabled", 1, 1 == $v );
echo $this->render_a0_switch( "wpa_client_secret_b64_encoded", "client_secret_b64_encoded", 1, 1 == $v );
?>
<div class="subelement">
<span class="description"><?php echo __( 'Enable if your client secret is base64 enabled. If you are not sure, check your clients page in Auth0. Displayed below the client secret on that page is the text "The Client Secret is not base64 encoded.
Expand Down Expand Up @@ -165,7 +165,7 @@ public function render_basic_description() {
}

public function basic_validation( $old_options, $input ) {

// $input['registration_enabled'] = $old_options['registration_enabled'];

$input['client_id'] = sanitize_text_field( $input['client_id'] );
Expand Down